Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '//// Close the form.
        Me.Close()
    End Sub

    Private Sub bRed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bRed.Click
        'Change form color to red.
        Me.BackColor = Color.Red
        Me.Text = "RED RED RED"
        Me.bRed.BackColor = Color.Yellow

    End Sub

    Private Sub bGreen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bGreen.Click
        'Change form color to green.
        Me.BackColor = Color.Green
        Me.Text = "GREEN GREEN"
        Me.bRed.BackColor = Color.Red

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        '//// Display the sum of the two input values.

        Dim a, b, result As Integer     ' Allocate memory for 3 variables.

        'INPUT:     Convert the input strings to numbers.
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)

        'PROCESS:   Add the two numbers.
        result = a + b

        'OUTPUT:    Convert result to a string & output it.
        Me.Label1.Text = "The sum is   " + Format(result)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        '//// Display the diff of the two input values.
        Dim a, b, result As Integer     ' Allocate memory for 3 variables.
        Dim s As String = "diff"

        'INPUT:     Convert the input strings to numbers.
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)

        'PROCESS:   Compute the result.
        result = a - b

        'OUTPUT:    Convert result to a string & output it.
        Me.Label1.Text = s + "is   " + Format(result)

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        '//// Display the diff of the two input values.
        Dim a, b, result As Integer     ' Allocate memory for 3 variables.
        Dim s As String = "mul"

        'INPUT:     Convert the input strings to numbers.
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)

        'PROCESS:   Compute the result.
        result = a * b

        'OUTPUT:    Convert result to a string & output it.
        Me.Label1.Text = s + "is   " + Format(result)

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        '//// Display the diff of the two input values.
        Dim a, b, result As Integer     ' Allocate memory for 3 variables.
        Dim s As String = "quotient"

        'INPUT:     Convert the input strings to numbers.
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)

        'PROCESS:   Compute the result.
        result = a / b

        'OUTPUT:    Convert result to a string & output it.
        Me.Label1.Text = s + " is   " + Format(result)

    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        '//// Display the diff of the two input values.
        Dim a, b, result As Integer     ' Allocate memory for 3 variables.
        Dim s As String = "remainder"

        'INPUT:     Convert the input strings to numbers.
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)

        'PROCESS:   Compute the result.
        result = a Mod b

        'OUTPUT:    Convert result to a string & output it.
        Me.Label1.Text = s + " is   " + Format(result)

    End Sub
End Class
