PDA

Click to See Complete Forum and Search --> : Ins key


Jelwood
Dec 8th, 1999, 12:34 AM
Hi all,
I've to put a routine in a textbox.Keypress
that overwrite the string in the textbox...
Thanks

MR
Dec 8th, 1999, 01:00 AM
Whats the question?

Jelwood
Dec 8th, 1999, 02:34 AM
I'm sorry for my bad english. I try to re-post the question:
Like the old applications for DOS where to replace a string the user press the INS key and then rewrite the word or date or whatever, I need to write a routine that when I write something in a (pre-filled) TextBox it overwrites what is written....
It has to do something like Deleting the char at the right of the cursor and replace with the pressed one... Thanks

Joacim Andersson
Dec 8th, 1999, 04:21 AM
Here's one way:

Private Sub Text1_KeyPress(KeyAscii As Integer)
If Text1.SelLength = 0 Then
Text1.SelLength = 1
End If
End Sub

Good luck!

------------------
Joacim Andersson
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)