Toggle's changing label ...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top