Reputation: 2479
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?
Upvotes: 1
Views: 238
Reputation: 62939
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);
}
}
Upvotes: 2