Toggle's changing label ...

B

bbddvv

how do i make the label on a toggle button say "SHOW" when it is unpressed,
and say "HIDE" when it is depressed?

help, thanx.
 
L

Lynn Trapp

Put this in the Click event of the toggle button.

If Me.YourToggleButton.Caption = "SHOW" Then
Me.YourToggleButton.Caption = "HIDE"
ELSE
Me.YourToggleButton.Caption = "SHOW"
End If
 
A

Allen Browne

Use the AfterUpdate event procedure of the toggle button to change its
Caption:

Private Sub tgl1_AfterUpate()
Me.tgl1.Caption = IIf(Me.tgl1.Value, "HIDE", "SHOW")
End Sub
 
F

fredg

how do i make the label on a toggle button say "SHOW" when it is unpressed,
and say "HIDE" when it is depressed?

help, thanx.

Code the Toggle buttons Click event:

If Me!ToggleName.Caption = "Show" then
Me!ToggleName.Caption = "Hide"
Else
Me!ToggleName.Caption = "Show"
End If
 
Top