Disable Menu Items |
Post Reply |
Author | |
Trond
Newbie Joined: 04 October 2004 Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 10 October 2004 at 2:50pm |
I can successfully disable and enable toolbar buttons on a commandbar, but I am not able to disable and enable menu-items on toolbar. What is the correct syntax? Thank you, |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Read this post, it should answer your queations:
https://forum.codejock.com/forum_posts.asp?TID=607&P N=1 Basically, to find a control in the Activemenubar you must set the recursive flag to True in the ActiveMenuBar.FindControl method. To find a popup control you must manually set the id of the control so you can find it. even if you specify an id when the popup control is created you must still set the id property of the control. Hope this helps Edited by SuperMario |
|
Trond
Newbie Joined: 04 October 2004 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Thank you but that did not help. This code will return the object on normal toolbars: Edited by Trond |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
If you are trying to find a popup menu, i.e. File, Edt, View, etc...
the designer does not assign an ID to these controls, you will need to
make sure you click on the popup control and fill in a constant for the
ID. To do this, you will need to go to CommandBars->Resource
Symbols... and click on the "New" button to create a constant to assign
to the popup. Then in your FindControl code you can search for
this constant.
"Another one: I want to activate the popup-menu on a commandbar from my code." Dim cmd As CommandBarPopup Set cmd = CommandBars.ActiveMenuBar.FindControl(, ID_FILE, , True) cmd.Execute In the above code, I added the constant ID_FILE using the method described above int he designer. |
|
gsaez78
Newbie Joined: 07 May 2005 Location: Chile Status: Offline Points: 2 |
Post Options
Thanks(0)
|
CommandBars.ActiveMenuBar.FindControl(, ID, , True).Enabled = False
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |