I am using VB6.
I want that in my whole program the user can only enter data as numbers (0-9), alphabetical (a-z) and . (dot/point).
How can I disable all the other keys?
I know the code how to permit the keys in the keypress event of any textbox
by using this code:
[CODE=vb]Dim comp As Boolean
comp = Chr(KeyAscii) Like "[1-9.0]"
If Chr(KeyAscii) = vbBack Then Exit Sub
If comp = False Then
KeyAscii = 0
End If[/CODE]
Now instead of writing it to all the text boxes (which are huge in number) I want to disable the other keys in start module.
How to do this?
I want that in my whole program the user can only enter data as numbers (0-9), alphabetical (a-z) and . (dot/point).
How can I disable all the other keys?
I know the code how to permit the keys in the keypress event of any textbox
by using this code:
[CODE=vb]Dim comp As Boolean
comp = Chr(KeyAscii) Like "[1-9.0]"
If Chr(KeyAscii) = vbBack Then Exit Sub
If comp = False Then
KeyAscii = 0
End If[/CODE]
Now instead of writing it to all the text boxes (which are huge in number) I want to disable the other keys in start module.
How to do this?
Comment