caption of Triplestate buttons

G

Guest

I can change the caption of a ToggleButton with a simple

If ToggleButton1 = False Then
ToggleButton1.Caption = "False"
ElseIf ToggleButton1 = True Then
ToggleButton1.Caption = "True"
End If

But if I enable Triplestate I can't get a different caption for "Null".
The help file says that triplestate controls don't generate click events.
So how can I get a new caption as well as just the greyed out "False"
caption ?
 
M

Mike Fogleman

With the Change Event:

Private Sub ToggleButton1_Change()
If IsNull(ToggleButton1.Value) Then
ToggleButton1.Caption = "Value is Null"
ElseIf ToggleButton1.Value = False Then
ToggleButton1.Caption = "Value is False"
ElseIf ToggleButton1.Value = True Then
ToggleButton1.Caption = "Value is True"
End If
End Sub

Mike F
 
G

Guest

Thanks Mike
--
David M
WinXP - Office2003 (Italian)


Mike Fogleman said:
With the Change Event:

Private Sub ToggleButton1_Change()
If IsNull(ToggleButton1.Value) Then
ToggleButton1.Caption = "Value is Null"
ElseIf ToggleButton1.Value = False Then
ToggleButton1.Caption = "Value is False"
ElseIf ToggleButton1.Value = True Then
ToggleButton1.Caption = "Value is True"
End If
End Sub

Mike F
 

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

Top