text box validations
-
hi to all in a form i have 3 text boxes one should accept numbers only 2nd should accepts only characters 3rd should accepts numbers+char+ spl chars,, for the 1st text box i wrote Private Sub TextBox1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Leave If Not IsNumeric(TextBox1.Text) Then TextBox1.Text = "" MessageBox.Show("you should enter only numbers") TextBox1.Focus() End If End Sub and this working for remaining two (2nd and 3rd) could you please help me
self confidence+hard work=SUCCESS
-
hi to all in a form i have 3 text boxes one should accept numbers only 2nd should accepts only characters 3rd should accepts numbers+char+ spl chars,, for the 1st text box i wrote Private Sub TextBox1_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Leave If Not IsNumeric(TextBox1.Text) Then TextBox1.Text = "" MessageBox.Show("you should enter only numbers") TextBox1.Focus() End If End Sub and this working for remaining two (2nd and 3rd) could you please help me
self confidence+hard work=SUCCESS
Check out the MaskedTextBox, this might meet your requirements. Google has a million examples on it's usage.