Keyboard into text box

0 views
Skip to first unread message

kirk shirley

unread,
Mar 29, 2005, 12:39:55 AM3/29/05
to
How do I get a keyboard input into a 2 digit string for a hex input.
I set the Properties of text box max length to 2 . I get a bell upon the
first digit being entered.
I would also like to allow input with only when a boolean variable is true.
The following only accepts 0-9 but I need it to be 0-F hex.
thanks
Kirk

Private Sub Text8_KeyPress(KeyAscii As Integer)
'MasterCable(SelectX, SelectY) = KeyAscii
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox "Numbers 0 to 9 only, please!", vbExclamation + vbOKOnly,
"Input Error"
KeyAscii = 0
End If

End Sub


Reply all
Reply to author
Forward
0 new messages