I'm using the following code and get a error message stating "Key not found."
Here is the code:
this.ToolbarsManager.Toolbars["m_toolBar"].Tools["Add User"].Control.Enabled = false;
I'ne also tried
this.ToolbarsManager.Toolbars["m_toolBar"].Tools["Add User"].SharedProps.Enabled = false;
I've put Add User in the tag and in the tag and key including the SharedProps tag.
Can anyone help?
It looks like you have not added a tool with a Key of "Add User" to the toolbar yet. Make sure to add the tool to the toolbar's Tools collection before using these lines of code.
I am doing a similar thing in VB and I cannot get the code from tonydavid to work.
When the app runs and the child form tools merge into the MDI Parent, are the tools still part of the Child ToolsBarManager or are they part of the Parent ToolsBarManager?
I am putting the code in the child form like this:
Me.UTM_TCM.Ribbon.ToolbarsManager.Toolbars[0].Tools("Delete").control.Enabled = False
But "Control" is not a valid property of Tools. I am using 2008 vol 1.
What am I doing wrong?
The Control property is only valid for tools which host other controls, such as ControlContainerTools and PopupControlContainerTools. If you want to disable a normal tool, you should instead set the SharedProps.Enabled property on the tool.
I found the proper code:
me.ultratoolbarsmanager.ribbon.tabitemtoolbar.tools("Delete").sharedprops.enabled = false