Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.

Keyboard into text box

1 view
Skip to first unread message

kirk shirley

Mar 29, 2005, 12:39:55 AM3/29/05
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.

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

0 new messages