Advertisement
Advertisement
| 05.23.2008 at 01:25PM PDT, ID: 23428881 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: |
Try
If Not (e.KeyCode >= Keys.NumPad0 And e.KeyCode <= Keys.NumPad9) And Not (e.KeyCode >= Keys.D0 And e.KeyCode <= Keys.D9) And Not (e.KeyValue >= Keys.A And e.KeyValue <= Keys.Z) Or e.Shift Or e.KeyCode = Keys.Space Then
If e.KeyCode <> Keys.Delete And e.KeyCode <> Keys.Back Then
e.SuppressKeyPress = True
End If
End If
Catch
If (e.KeyCode >= Keys.D0 And e.KeyCode <= Keys.D9) And e.KeyCode <> Keys.Space Then
MsgBox("Only single numbers and letters are allowed.", MsgBoxStyle.OkOnly, "Information")
End If
End Try
|