Re: Textbox control question
- From: Anonymous <no.reply@xxxxxxxx>
- Date: Thu, 11 Oct 2007 03:03:28 +0100
Larry Serflaten wrote:
"Anonymous" <no.reply@xxxxxxxx> wrote
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
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?
One way would be to lock the textbox so the user can't enter text into it,
and then handle all the input yourself. For a real quick example, add a
textbox to a new form and set its Multiline property to true. Then paste
in the code below and try it out....
LFS
<code snipped>
Larry, I'm totally in awe of what you manged to produced with such a short snippet of code - Fantastic!. (Not one to be easily excited, I am literaly frothing at the mouth over this - bcos I was getting no where with this). this saves me possibly, several days of fiddling about and searching ngs etc.
This is a very good starting point to me - as it appears to meet al of the basic requirements I outlined earlier. the only thing strange I noticed is that CR's are not being handled properly - My first guess is to write a string cleaning funtion taht will replace the CR character with the correct representation to allow it to be displayed correctly - am I correct, or am I barking up the wrong tree. If my logic is faulty, I'd be grateful if you could tell me how to fix the code you sent so that (new) lines (i.e. carriage returns) are displayed on a new line - currently, everything is being displayed on one LONG line .. MTIA
.
- Follow-Ups:
- Re: Textbox control question
- From: Larry Serflaten
- Re: Textbox control question
- References:
- Textbox control question
- From: Anonymous
- Re: Textbox control question
- From: Larry Serflaten
- Textbox control question
- Prev by Date: how to remove a menu from Excel?!!
- Next by Date: Re: Textbox control question
- Previous by thread: Re: Textbox control question
- Next by thread: Re: Textbox control question
- Index(es):
Relevant Pages
|