I am working on windows vb.net applications.In My form I created a textbox.But I would like to enter only integer values in this textbox.How to do this"Shall I need to change any property of the textbox.Can anyone help me....
How to do this?
Collapse
X
-
I don't know for vb.net there is a isnumeric( ) function, try searching for that.Originally posted by sdandaI am working on windows vb.net applications.In My form I created a textbox.But I would like to enter only integer values in this textbox.How to do this"Shall I need to change any property of the textbox.Can anyone help me.... -
This should do it for you
[CODE=vbnet] Private Sub TextBox1_KeyPre ss(ByVal sender As Object, ByVal e As System.Windows. Forms.KeyPressE ventArgs) Handles TextBox1.KeyPre ss
If e.KeyChar.IsNum ber(e.KeyChar) = False Then
e.Handled = True
End If
End Sub[/CODE]
TorggComment
Comment