0

Possible Duplicate:
Disable default shortcuts on a TabControl

This is a C# WinForms app:

A TabControl by default will change tabs when the Control+PageUp or PageDown keys are pressed.

How do I prevent this behavior?

I've tried to handle the event as follows, but the control changes tab pages anyway:

    private void tabControl_KeyDown(object sender, KeyEventArgs e)
    {
        if (ModifierKeys != Keys.Control) return;
        if (e.KeyCode == Keys.PageUp || e.KeyCode == Keys.PageDown)
            e.Handled = true;
    }
Community
  • 1
  • 1
JYelton
  • 34,250
  • 25
  • 123
  • 184
  • 1
    I think this answer from Hans Passant will help: http://stackoverflow.com/questions/1952839/disable-default-shortcuts-on-a-tabcontrol – Jeff Ogata Oct 05 '10 at 00:26
  • This is precisely it, looks like my searches were too specific thus why I couldn't find it. – JYelton Oct 05 '10 at 01:07

0 Answers0