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
712
setting CtrlShiftTab shortcut to ButtonTool menu item
posted
Hi, I wanna set a shortcut key CtrlShiftTab to a ButtonTool menu item. How could i do that? Your help will be highly appreciated. Thanks
Parents
  • 5118
    posted

    We use the System.Windows.Forms.Shortcut enum which does not include that in the enum.  So to get something like this to happen you can handle the forms KeyDown and check the keys and then do a call to a function that does the same code that the button click would have done. 

    For instance:

            private void Form1_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Tab && e.Control && e.Shift)
                {
                    //perform the action you like
                    MyButtonToolClickCode();
                }
            }
    
            private void MyButtonToolClickCode()
            {
                // MyButton ToolClick code 
            }
    
            private void ultraToolbarsManager1_ToolClick(object sender, ToolClickEventArgs e)
            {
                if (e.Tool.Key == "ButtonTool1")
                {
                    MyButtonToolClickCode();
                }
            }
    
Reply Children
No Data