Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default caption of Triplestate buttons

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 ?

--
David M
WinXP - Office2003 (Italian)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default caption of Triplestate buttons

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
"#DIV/0" wrote in message
...
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 ?

--
David M
WinXP - Office2003 (Italian)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default caption of Triplestate buttons

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


"Mike Fogleman" wrote:

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
"#DIV/0" wrote in message
...
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 ?

--
David M
WinXP - Office2003 (Italian)




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Caption on command buttons shrinking M.Mustoe Excel Programming 0 September 9th 07 03:10 AM
How to reference win.caption, when caption changes Paul987[_21_] Excel Programming 3 April 7th 06 05:09 PM
Togglebutton with the triplestate turned to True stakar[_33_] Excel Programming 1 August 23rd 04 04:18 PM
Changing caption text and hiding buttons Paul_Russell[_6_] Excel Programming 2 February 5th 04 08:46 PM
Sort buttons by caption? David Excel Programming 3 December 26th 03 07:54 PM


All times are GMT +1. The time now is 08:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"