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
575
ToolClick event firing w/shortcuts even when tool is hidden?
posted

This seems like a bug to me but I thought I would see if there is a reason.  I noticed that when I assign a shortcut to a tool like Ctrl+R, that the ToolClick event fires even when the tool is hidden (shared props - hidden everywhere).  To me it seems this should not happen.  In my case I store a command object in each tool for execution and those commands are not set when the tool is torn down and hidden.

 

See the attached png file.

  • 71886
    Offline posted

    Hello Geoff,

    I believe that this behavior is expected. A possible approach to avoid executing your code when the user presses the key combination for a not visible tool would be to check the state of the tool, like this:

            private void ultraToolbarsManager1_ToolClick(object sender, ToolClickEventArgs e)

            {

                if(e.Tool.VisibleResolved)

                {

                    //...your code goes here...

                }

            }

    Please do not hesitate to ask if something comes up.