Toggle toolbars

Toggle toolbars

Anonymous
Not applicable
231 Views
0 Replies
Message 1 of 1

Toggle toolbars

Anonymous
Not applicable
I have this dummy code:

Public Sub test()
Dim currMenuGroup As AcadMenuGroup
Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("CSLUTILS_EN")

' Create the new toolbar
Dim newToolbar As AcadToolbar
Set newToolbar = currMenuGroup.Toolbars.Item("CSL Profiles")

If newToolbar.Visible Then
MsgBox "toolbar is visible"
Else
MsgBox "toolbar is hidden"
End If

End Sub

Now, what I really want is a checkable menu item that reflects the toolbars current visibility state and toggles it on or off. Now, in the CUI I know I can use some $(if,...) code because I examined the autocad CUI file for UCSICON.

But I don't know how to apply that principle to teh above macro code. How can I write a macro or something that is telling it to run the toolbar _show or the toolbar _hide

?

I know I can right-click in the toolbar area and choose toolbars, but I would still like to know.

Andrew
0 Likes
232 Views
0 Replies
Replies (0)