Public Class Form1
    Dim n As Integer = 0

    Private Sub Button1_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) _
    Handles Button1.Click
        'Exit the form
        Me.Close()

    End Sub

    Private Sub ListBox1_SelectedIndexChanged _
    (ByVal sender As System.Object, _
     ByVal e As System.EventArgs) _
     Handles ListBox1.SelectedIndexChanged
        '?????
        Me.Label1.Text = n


    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        'Add the two values
        Dim a, b, c As Integer
        Dim s As String

        'INPUT
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)
        'PROCESS
        c = a + b
        s = "the sum is: "
        'OUTPUT
        Me.ListBox1.Items.Add(s & Format(c))
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        'Subtract
        'Subtract the values
        Dim a, b, c As Integer
        Dim s As String

        'INPUT
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)
        'PROCESS
        c = a - b
        s = "the difference is: "
        'OUTPUT
        Me.ListBox1.Items.Add(s & Format(c))
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        'Clear the output lines.
        Me.ListBox1.Items.Clear()

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        'Multiply
        'Multiply the values
        Dim a, b, c As Integer
        Dim s As String

        'INPUT
        a = Val(Me.TextBox1.Text)
        b = Val(Me.TextBox2.Text)
        'PROCESS
        c = a * b
        s = "the product is: "
        'OUTPUT
        Me.ListBox1.Items.Add(s & Format(c))
    End Sub
End Class
