Writing Code in Visual Basic


1
2
3
4
5
6
7
8
9
Public Class Form1
    'Programmer: Janet Joy
    'Change the color with one sub
    Private Sub Color_Click(sender As Object, e As EventArgs) _
         Handles BtnRed.Click, BtnBlue.Click, BtnGreen.Click, BtnYellow.Click
        Me.Text = "You picked " & sender.text
        Me.BackColor = sender.backcolor
    End Sub
End Class
CODE

Print

NEXT: The Visible Property