tags:

views:

25

answers:

1

I have a TabControl in the mainwindow of my app. I also Have a keyBinding for CTRL-TAB. However, whenever the TabControl is selected and CTRL-TAB is pressed the keybinding is not triggered because the TabControl handles the input and cycles through the tabs.

Is there any way that I can fix this?

+1  A: 

Probably the easiest way to do this is to subclass TabControl and override the OnKeyDown method:

public class TabControlIgnoresCtrlTab : TabControl
{
  protected override void OnKeyDown(KeyEventArgs e)
  {
    if(e.Key == Key.Tab) return;
    base.OnKeyDown(e);
  }
}
Ray Burns