Thread: Option Buttons
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
HSalim[MVP] HSalim[MVP] is offline
external usenet poster
 
Posts: 70
Default Option Buttons

Thanks Bob!
Exactly what i needed.
regards
Habib


--
www.DynExtra.com
A resource for the Microsoft Dynamics Community
Featuring FAQs, File Exchange and more
Current member count: 40
--------------------------------------------
Share your knowledge. Add your favorite questions and answers
Help add questions to this site! We want Your input.
--------------------------------------------
"Bob Phillips" wrote in message
...
No, on toolbars setting the state property makes it looked raised or not.

You could try something like this, that creates a pseudo-checkmark

Sub BuildMenu()

With Application.CommandBars.Add(Name:="Test", temporary:=True)

With .Controls.Add(Type:=msoControlButton)
.Caption = "check"
.Style = msoButtonIcon
.Tag = "checked"
.FaceId = 1087
.OnAction = "checkMe"
End With

With .Controls.Add(Type:=msoControlButton)
.Caption = "myMacro"
.Style = msoButtonCaption
.FaceId = 1087
.OnAction = "myMacro"
End With

.Visible = True

End With

End Sub

Sub checkme()

With Application.CommandBars.ActionControl

If .Tag = "checked" Then
.Tag = "unchecked"
.FaceId = 1091
Else
.Tag = "checked"
.FaceId = 1087
End If

End With

End Sub

Sub myMacro()

MsgBox Application.CommandBars("Test").Controls("check"). Tag
End Sub



--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"HSalim[MVP]" wrote in message
...
Bob
Thanks for the quick reply.
I'm not using menus - that is an option I could consider
Is there a way to do this using just toolbars?

From what I have been reading, I think I'll have to reset the toolbar

button
face image.
I know that these are special image files, so I guess I have some more
digging to do...
Regards
HS

--
www.DynExtra.com
A resource for the Microsoft Dynamics Community
Featuring FAQs, File Exchange and more
Current member count: 40
--------------------------------------------
Share your knowledge. Add your favorite questions and answers
Help add questions to this site! We want Your input.
--------------------------------------------