msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Textbox control questions

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
Anonymous



Joined: 04 Oct 2007
Posts: 20

PostPosted: Wed Oct 10, 2007 5:55 pm    Post subject: Textbox control questions Reply with quote

I am writing a little application that consists of a window that accepts
user commands into, in an interactive way.

I am using a textbox control on a form, to accept user input. I need to
know how to do the ff (which I suspect involves subclassing the text box
control):

1). How do I set the cursor to the END of the LAST LINE in the text box ?
2). I need to return the user to the last line as soon as the user
starts typing, no matter where they had placed the cursor in the textbox
initially - so the user always enters commands from the last line in the
text box - how may I do this?

3). I need to trap the keyup and keydown so that instead of the cursor
moving up (or down), I display the words "UP" (or "DOWN" respectively)
on the LAST LINE - how do I do this?

4). I will be displaying a prompt ">" at the begining of the last line,
I want to prevent the user from being able to move leftward past the ">"
which will be displayed at the the begining of the LAST line displayed
in the textebox - how do I do this?

Archived from group: microsoft>public>vb>enterprise
Back to top
View user's profile Send private message
amdrit



Joined: 04 Oct 2007
Posts: 8

PostPosted: Mon Oct 15, 2007 2:08 pm    Post subject: Re: Textbox control questions Reply with quote

"Anonymous" wrote in message @bt.com...
>I am writing a little application that consists of a window that accepts
>user commands into, in an interactive way.
>
> I am using a textbox control on a form, to accept user input. I need to
> know how to do the ff (which I suspect involves subclassing the text box
> control):

I have no idea what ff represents..


> 1). How do I set the cursor to the END of the LAST LINE in the text box ?

Take a look at the textbox methods:
SelLength
SelStart
SelText

> 2). I need to return the user to the last line as soon as the user starts
> typing, no matter where they had placed the cursor in the textbox
> initially - so the user always enters commands from the last line in the
> text box - how may I do this?

> 3). I need to trap the keyup and keydown so that instead of the cursor
> moving up (or down), I display the words "UP" (or "DOWN" respectively) on
> the LAST LINE - how do I do this?

Take a look at KeyPreview on the form
Manage your keyup/keydown here
Seach keycode constants in VB Help

> 4). I will be displaying a prompt ">" at the begining of the last line, I
> want to prevent the user from being able to move leftward past the ">"
> which will be displayed at the the begining of the LAST line displayed in
> the textebox - how do I do this?

Take a look at the textbox's keydown method
determine if left arrow should be accepted

Take a look at the textbox's mousedown method
determine if the cursor should be relocated

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group