VB6.0-"Change KeyAscii in KeyPress" in VB.net

Gagel

New member
Joined
Jan 20, 2003
Messages
1
Location
Frankfurt, Germany
In VB 6.0 I used the KeyPress-Event to change user inputs.

E.g. when a textbox has the text "31.0" and the user hits the "2"-key, I changed the KeyAscii paramter to 0, because there is no 31th day in February.

E.g. when I didnt want that the user is able to type in german letter (like
 
Last edited by a moderator:
You can use the Keypress to limit the input or compare the input...
Code:
If Not e.KeyChar.(more methods here) Then

you can also use the Validating event, and if you dont want to accept the input, you can...
Code:
e.Cancel = True
 
Back
Top