Connecting Tech Pros Worldwide Forums | Help | Site Map

Appending Input to TextBox

Richard Grene
Guest
 
Posts: n/a
#1: Nov 20 '05
I am setting a textbox to a value (ex: ABC). I then setfocus to the textbox
and I want my input to start after the ABC. So if I then enter DEF, my
textbox will show ABCDEF. I need this to occur one character at a time as it
is being entered, not at validating time because I have to examine the
contents of the textbox at each KeyPress Event.

Any help will be appreciated.

Thanks,
Richard



Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 20 '05

re: Appending Input to TextBox


* "Richard Grene" <rgrene@s4si.com> scripsit:[color=blue]
> I am setting a textbox to a value (ex: ABC). I then setfocus to the textbox
> and I want my input to start after the ABC. So if I then enter DEF, my
> textbox will show ABCDEF. I need this to occur one character at a time as it
> is being entered, not at validating time because I have to examine the
> contents of the textbox at each KeyPress Event.[/color]

Why? What if the user pastes some text from the clipboard to edit it in
the textbox?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Cor Ligthert
Guest
 
Posts: n/a
#3: Nov 20 '05

re: Appending Input to TextBox


Hi Richard,

Probably you need only the last line, however this is nice to see.

I hope it helps?

Cor
\\\
TextBox1.Text = "ABC"
For i As Integer = 1 To 3
Me.TextBox1.Text += ChrW(67 + i)
Me.Show()
Application.DoEvents()
Threading.Thread.Sleep(1000)
Next
TextBox1.Select(TextBox1.Text.Length, 0)
///


Closed Thread