If...Then...Else If Statement:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim text1, text2 As Integer
text1 = TextBox1.Text
text2 = TextBox2.Text
If text1 >= 80 And text2 >= 80 Then
Label3.Text = "Your grade is A Plus"
ElseIf text1 >= 60 And text1 < 80 And text2 >= 60 And text2 < 90 Then
Label3.Text = "Your grade is A"
Else
Label3.Text = "Please re sit for another test."
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BackColor = Color.Brown
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim text1, text2 As Integer
text1 = TextBox1.Text
text2 = TextBox2.Text
If text1 >= 80 And text2 >= 80 Then
Label3.Text = "Your grade is A Plus"
ElseIf text1 >= 60 And text1 < 80 And text2 >= 60 And text2 < 90 Then
Label3.Text = "Your grade is A"
Else
Label3.Text = "Please re sit for another test."
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BackColor = Color.Brown
End Sub
End Class
No comments:
Post a Comment