Friday, August 27, 2010

VB6.0 Only Digit in Textbox

Private Sub Text1_KeyPress(KeyAscii As Integer)

Dim str As String

str = "0123456789"
If KeyAscii > 26 Then
If InStr(str, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub

No comments: