Re: Textbox control question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




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
.



Relevant Pages

  • Re: Textbox control question
    ... I am using a textbox control on a form, to accept user input. ... I will be displaying a prompt ">" at the begining of the last line, ...
    (microsoft.public.vb.general.discussion)
  • Re: Textbox control question
    ... I am using a textbox control on a form, ... I will be displaying a prompt ">" at the begining of the last line, ...
    (microsoft.public.vb.general.discussion)
  • Multilingual application
    ... that we are displaying contents in some other language (user selected ... we are having some textbox for user input. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: combo box columns and key input
    ... Do not store the text along w/ the number in the table. ... The TextBox is an unbound control ... and if you hit 0 the ComboBox displayed None ... So you are displaying 0 - max num in the combo box ...
    (comp.databases.ms-access)
  • Re: asp.net chinese encoding
    ... on the browser occurs with multiline textbox. ... displayed the chinese character symbols correctly. ... control. ... displaying chinese character symbols correctly when the htmltextarea ...
    (microsoft.public.dotnet.languages.csharp)