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
540
Which event to trap?
posted

Hi

I have a typical main menu above my winform which has an Edit drop down with Cut/Copy/Paste options. What event should I trap when the user clicks on Edit so I can disable the Cut/Copy/Paste options based on the context before the Edit menu is actually displayed?

Thanks

Regards


Yahya

  • 135
    posted

     There's a BeforeToolDropDown event which you can subscribe to. Here's an example:

            private void ultraToolbarsManager1_BeforeToolDropdown(object sender, Infragistics.Win.UltraWinToolbars.BeforeToolDropdownEventArgs e)
            {
                if (e.Tool.Key == "Edit")
                {
                    if (condition)
                    {
                        ((Infragistics.Win.UltraWinToolbars.ButtonTool)ultraToolbarsManager1.Tools["ButtonTool2"]).SharedProps.Enabled = false;
                    }
                }
            }