crazymarvin
Member
hey, I need some help with this:
it will only display the warning message if the 1st number you enter is a number, but it will let you type something like 'martyn1234', any idea's why? or how i can get it to display the message if there are any numbers in the text box?
'CustomerName' is publicly defined as a string on a module, if that is revelant
thanks, Martyn
VB.NET:
Private Sub txtboxName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtboxName.TextChanged
If txtboxName.Text = "" Then Exit Sub
CustomerName = txtboxName.Text
If IsNumeric(CustomerName) = True Then
MessageBox.Show("You have to enter a vaild name in this field", "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtboxName.Undo()
End If
End Sub
'CustomerName' is publicly defined as a string on a module, if that is revelant
thanks, Martyn