Public Class Form1

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        Label1.ForeColor = Color.Red
        Label2.ForeColor = Color.Black
        Label3.ForeColor = Color.Black
        Label4.ForeColor = Color.Black
    End Sub

    Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
        Label2.ForeColor = Color.Red
        Label1.ForeColor = Color.Black
        Label3.ForeColor = Color.Black
        Label4.ForeColor = Color.Black
    End Sub

    Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
        Label3.ForeColor = Color.Red
        Label4.ForeColor = Color.Black
        Label1.ForeColor = Color.Black
        Label2.ForeColor = Color.Black
    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click
        Label4.ForeColor = Color.Red
        Label1.ForeColor = Color.Black
        Label2.ForeColor = Color.Black
        Label3.ForeColor = Color.Black
    End Sub

    Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click
        If (Label1.ForeColor = Color.Red) Then
            TextBox3.Text = Str(CDbl(TextBox1.Text) + CDbl(TextBox2.Text))
        End If
        If (Label2.ForeColor = Color.Red) Then
            TextBox3.Text = Str(CDbl(TextBox1.Text) - CDbl(TextBox2.Text))
        End If
        If (Label3.ForeColor = Color.Red) Then
            TextBox3.Text = Str(CDbl(TextBox1.Text) * CDbl(TextBox2.Text))
        End If
        If (Label4.ForeColor = Color.Red) Then
            TextBox3.Text = Str(CDbl(TextBox1.Text) / CDbl(TextBox2.Text))
        End If
    End Sub
End Class
