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

 

- Info:

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

 

- Procedure:

  - Create VB .NET Console Application Test.vb

 

    Test.vb

    Module Module1

    

      Sub Main()

        

        Dim value = 10

        Dim text  = "bird"

 

        'if...then in single line.

        If  value = 10 Then MsgBox("Value = 10") 'End If is not allowed here

    

        'if...then in multiple lines.

        If  text  = "bird" Then

          MsgBox("text equals bird")

        End If

    

      End Sub

    

    End Module