Force Ctrl+F1 to behave like Ctrl+Tab

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrus

    Force Ctrl+F1 to behave like Ctrl+Tab

    MDI WinForms 2 application.
    I need that Ctrl+F1 cycles through windows like Ctrl+Tab and Ctrl+Tab is
    redefined.
    I overrided MDI child form OnKeypress method but Ctrl+F1 press is ignored.
    For unknown reason base.ProcessCmd Key calls method itself.

    How to fix ?

    Andrus.

    protected override bool ProcessCmdKey(r ef Message msg, Keys keyData)
    {
    switch (keyData)
    {
    case Keys.Control | Keys.Tab:
    // ... custom processing occurs hear.
    return true;

    case Keys.Control | Keys.F1:
    keyData = Keys.Control | Keys.Tab ;
    break;
    }
    return base.ProcessCmd Key(ref msg, keyData);
    }

Working...