Sometimes people are just trying to be funny, or they are literally trying to break your program. If the data is indeed only alphabetic letters (no symbols, no numbers or any other punctuation characters) the test succeeds and stores True inside the Name Valid variable. This is because it becomes more legible than just a normal set of numbers. You could say that a program's testers are supposed to do this; yes, they should - nobody else should. If not, if there is even just one unallowed character that is not supposed to be there, the Match method will return False. Instead of you having to loop through each character to determine what that character is, you simply need the correct Regular Expression pattern. Clear() Surname Valid = False Else Surname Valid = True End If End Sub It is basically the exact same code for the Name box, but I just included the capability to comprehend a space character as well. People expect to enter a phone number in a format similar to this: ###-###-####. To add or remove objects in the list at run time, use methods of the Combo Box).You can assign an array of object references with the Add Range method.
To display a list to which no new values can be added, use a List Box control.
If the e-mail address is not in the standard format (containing "@" and "."), the validation fails, an Error Provider icon is displayed, and the event is canceled.
This example requires that a Text Box and Error Provider control have been created on a form.
Raises the Invalidated event with a specified region of the control to invalidate.(Inherited from Control.) property also specifies whether the text portion can be edited.
See Combo Box Style for the available settings and their effects.