IF Condition

If Then statement is a control structure which executes a set of code only when the given condition is true.

Syntax: 
If [Condition] Then
   [Statements]
In the above syntax when the Condition is true then the Statements after Then are executed.

Example:
Private Sub Button1_Click_1(ByVal sender As System.Object,
     ByVal e As System.EventArgs) Handles Button1.Click
   If Val(TextBox1.Text) > 25 Then
       TextBox2.Text = "Eligible"
   End If

No comments:

Post a Comment