So the code for allowing only numbers in the textbox for employee ID is:
Just copy the code in the box given below:Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Asc(e.KeyChar) <> 13 AndAlso Asc(e.KeyChar) <> 8 AndAlso Not IsNumeric(e.KeyChar) Then MessageBox.Show("Please enter numbers only") e.Handled = True End IfEnd Sub |


ReplyDeleteThanks for sharing this good blog.It's amazing blog
.Net Online Training Hyderabd