Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
570
How to Enable/Disable individual tool items?
posted

Depending on my application's database connection status, I need to disable/enable specific tool items in the main menu.  How is this done in the UltraToolbarsManager?  I am getting the tools by looping through the UltraToolbarsManager.Tools collection, and looking at each tool's Key property.  Once I have the tools I'm looking for, how can I disable/enable them?  I need to do this in a way that cannot be overriden via the user Customization features.

Thanks,

Justin

Parents
No Data
Reply
  • 570
    Verified Answer
    posted

    I guess I just needed to look at it for a few more minutes.  Here's what I did:

    Normal 0 false false false EN-US X-NONE X-NONE for (int i = 0; i < this.toolbarManager.Tools.Count; i++) {

       if (this.toolbarManager.Tools[i].Key == "mnuDatabases" || this.toolbarManager.Tools[i].Key == "mnuDBOpen") {

          this.toolbarManager.Tools[i].SharedProps.Enabled = true;

       } else {

          this.toolbarManager.Tools[i].SharedProps.Enabled = false;

       }

    }

Children
No Data