aah, wasnt there an easy way to make the textbox accept numbers only?
Printable View
aah, wasnt there an easy way to make the textbox accept numbers only?
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress Dim I As Integer = Convert.ToInt32(e.KeyChar) If Not (System.Char.IsNumber(e.KeyChar)) Then If I <> 8 Then e.Handled = True End If End If End Sub
Here is the thread where a lot of it was discussed:
http://www.vbforums.com/showthread.p...hreadid=206548
eeh, thanks it works now :)
how can I check to see if the user has pressed enter? I have to check keychar with keys.enter, but how?