I want to make a TextBox control that only accepts numerical values.
How can I do this in VB6?
I used this code in my project:
Private Sub txtReceiptID_KeyPress(KeyAscii As Integer) Dim Keychar As String If KeyAscii > 31 Then Keychar = Chr(KeyAscii) If Not IsNumeric(Keychar) Then KeyAscii = 0 End If End If
End Sub