Thread: Toggle Button
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Toggle Button

Whilst I would maybe question the logic of doing this because:
- The idea of the control is that its state is visible from its appearance
- Will the user be confused if they should click it to make if Off, or it
currently is Off. I prefer the CheckBox for clarity.

Ignores the Null state, which you can add if desired.

Private Sub ToggleButton1_Click()

With ToggleButton1
If .Value = True Then
.Caption = "On"
Else
.Caption = "Off"
End If
End With

End Sub

NickHK

"blackbox via OfficeKB.com" <u20390@uwe wrote in message
news:7355a9b84c3b2@uwe...
How can I make the caption of the toggle button to change based on wether

it
is on or off.

On/Off Yes/No

just something simple like that.

--
Message posted via http://www.officekb.com