5.1 Checking/Validating data using IF Statements in Visual Basic.NET

July 23, 2009 - 5:18 pm

Using an IF Statement to Validate text placed in a text box on button press:

Here’s the code I used in this:

Dim Captain As String

Captain = TextBoxCaptain.Text
Captain = Captain.ToUpper

If Captain = “PICARD” Or Captain = “KIRK” Or Captain = “ARCHER” Or Captain = “PIKE” Or Captain = “JANEWAY” Then

MsgBox(”Indeed, Warp Factor 9!”)
Else
MsgBox(Captain & ” has never been a Captain”)
End If

Have fun!

Duration : 0:7:25


[youtube JzuMl0KMSz0]

3 Responses to “5.1 Checking/Validating data using IF Statements in Visual Basic.NET”

  1. MARTYNwatton Says:

    5 star all the way
    5 star all the way

  2. MARTYNwatton Says:

    thanks!!!!
    thanks!!!!

  3. DrummerKeepkeep Says:

    5*! thanks for the …
    5*! thanks for the help!

Leave a Reply