·  VB .NET – Syntax – Conditional Statements – If...Then...Else

 

- Info:

  - This tutorial shows how to use If...Then...Else conditional statements.

  - You will get Syntax error if you don't go to new line after keyword Then.

 

- Procedure:

  - Create VB .NET Console Application Test.vb

 

    Test.vb

    Module Module1

    

      Sub Main()

    

       Dim value = 101

        Dim text  = "bird"

        

        If value = 10 Then

          MsgBox("Value = 10")

        Else If text = "bird" Then

          MsgBox("text equals bird")

        Else

          MsgBox("No match found")

        End If

    

      End Sub

    

    End Module