There are two objects on the page: the label and the button. The label object's ID is ColorLabel, and the button's ID is ChangeColors. The script below (which was inserted by the Control Pad's Script Wizard) does all the work.
<SCRIPT LANGUAGE="VBScript"> <!-- Sub ChangeColors_Click() ColorLabel.BackColor = &H00000000 ColorLabel.ForeColor = &H000000FF end sub --> </SCRIPT>
The SUB procedure's name specifies that it runs whenever the button's Click event fires. The procedure's name is in the form: ObjectID_EventName. So the SUB procedure (ChangeColors_Click) above is called when the Click event of the ChangeColors object fires.
You might have noticed that this is a one-shot deal: the label is loaded as yellow on blue, you click, and the label changes to reb on black. Clicking the button a second time changes the label's colors to red on black -- which doesn't look much different than red on black.
Return to Color Changing Label example