Use a ToggleButton control to enable an option and leave it that way until the user depresses the button again (see Figure 3-20). This control presents an on/off switch whose appearance changes depending on whether or not it the user has depressed it. The ToggleButton control has a Picture property you could change depending on the state of the button.
In the following example, the condition of the ToggleButton control is tested using a Select ... Case statement and an appropriate message is displayed:
Private Sub ToggleButton1_Click() Select Case ToggleButton1.Value Case False
MsgBox "ToggleButton1 is Off" Case True MsgBox "ToggleButton1 is On" End Select
Was this article helpful?