Public Class Form1 '======== OUTPUT METHODS ======== Sub say(ByVal s As String) '....Output a string. '-- Me.TextBox1.Text = s Me.oResult.Items.Add(s) End Sub Sub clearout() '....Clear the output area. Me.oResult.Items.Clear() End Sub '======== INPUT METHODS ======== Function getFirst() As Integer 'Return the value from the first textbox. Dim s As String Dim result As Integer s = Me.iFirst.Text result = Val(s) Return result End Function Function getSecond() As Integer 'Return the value from the second textbox. Dim result As Integer result = Val(Me.iSecond.Text) Return result End Function '======== SNOWMAN METHODS ======== Public Sub body() ' this subroutine draws the body say(" * *") say(" * * *") say(" * *") say(" * * *") say(" * *") say(" * * *") say(" * *") say(" *********") End Sub Public Sub hat() ' this subroutine draws the hat say(" ***** ") say(" * * ") say(" * * ") say(" ********* ") End Sub Public Sub head() ' this subroutine draws the head say(" * *") say(" * 0 0 *") say(" * ^ *") say(" * \_/ *") say(" * *") say(" *********") End Sub '.....(End of optional methods)..... '======== BEGIN EVENT-HANDLERS HERE.... ======== Private Sub b1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b1.Click 'Write my name in Label2' Me.Label2.Text = "Michael A. Miro" End Sub Private Sub b2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b2.Click 'Change background colors of off numbered buttons' Me.b1.BackColor = Color.LightGreen Me.b3.BackColor = Color.LightGreen Me.b5.BackColor = Color.LightGreen Me.b7.BackColor = Color.LightGreen Me.b9.BackColor = Color.LightGreen Me.b11.BackColor = Color.LightGreen Me.b13.BackColor = Color.LightGreen Me.b15.BackColor = Color.LightGreen Me.b17.BackColor = Color.LightGreen Me.b19.BackColor = Color.LightGreen End Sub Private Sub b3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b3.Click 'Changes allprime numbers to a light red' Me.b1.BackColor = Color.Pink Me.b2.BackColor = Color.Pink Me.b3.BackColor = Color.Pink Me.b5.BackColor = Color.Pink Me.b7.BackColor = Color.Pink Me.b11.BackColor = Color.Pink Me.b13.BackColor = Color.Pink Me.b17.BackColor = Color.Pink Me.b19.BackColor = Color.Pink End Sub Private Sub b4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b4.Click 'Output message that gives total of numbers in input textboxes' 'Declarations' Dim first As Integer Dim second As Integer Dim third As Integer Dim result As Integer 'Input' first = Me.iFirst.Text second = Me.iSecond.Text third = Me.iThird.Text 'Process' result = first + second + third 'Output' Me.oResult.Items.Add(result) End Sub Private Sub b6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b6.Click hat() ' this subroutine draws the hat say(" ***** ") say(" * * ") say(" * * ") say(" ********* ") head() ' this subroutine draws the head say(" * *") say(" * 0 0 *") say(" * ^ *") say(" * \_/ *") say(" * *") say(" *********") body() ' this subroutine draws the body say(" * *") say(" * * *") say(" * *") say(" * * *") say(" * *") say(" * * *") say(" * *") say(" *********") End Sub Private Sub b8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b8.Click Me.Close() End Sub End Class