Skip to main content
1 of 2
Saleika
  • 1.3k
  • 12
  • 18

How to use short cuts in dockable windows

I have developed a custom dockable window with textboxes, comboboxes and buttons for use in ArcMap. After the user clicks on a button in the dockable window a function is invoked. How can I invoke the function/button_click-event using short cuts. Where do I have to wire the event?:

this.KeyDown +=new KeyEventHandler(MyDockableWindow_KeyDown);

Where do I have to impement the event?

private void MyDockableWindow_KeyDown(object sender, KeyEventArgs e)
    {
        switch (e.KeyCode)
        {
            case Keys.F1:
                button1.PerformClick();
                break;
            case Keys.F2:
                button2.PerformClick();
                break;
            case Keys.F3:
                button3.PerformClick();
                break;
            case Keys.F4:
                button4.PerformClick();
                break;
        }
    }
Saleika
  • 1.3k
  • 12
  • 18