Effective February 22, 2024, Google Groups will no longer support new Usenet content. Posting and subscribing will be disallowed, and new content from Usenet peers will not appear. Viewing and searching of historical data will still be supported as it is done today.

Keyboard into text box

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

Reply all
Reply to author
0 new messages