If are using VB.Net with ASP then you can have a look at the
http://www.w3schools.com/aspnet/control_reqfieldvalidator.asp[
^] control. There are other validation controls available in ASP.Net as well.
If you are looking at windows forms, then you can build custom validations into your code.
VB.NET TextBox Validation Control[
^] is a decent example where this has been done. Other similar examples are available on the internet if you do a search.