My application has a main window that contain a TabControl with about 7 TabItems. Inside each tabItem I put a UserControl.
I would like that (no matter the active tab, or control) when the user press a combination of keys then user-interface jumps to a specific tab. that is, The same behavior that Firefox: alt+1 goes to the first tab, alt+n goes to the N tab.
How can I achieve this? or... what should I start searching?
I can't show you any code because the problem is that I don't know how to start.
Thanks
Press Alt + Tab to move between windows. Right-click on a tab and select Move tab to another window.
Shortcut 1:Press and hold the [Alt] key > Click the [Tab] key once. A box with screen shots representing all of the open applications will appear. Keep the [Alt] key pressed down and press the [Tab] key or arrows to switch between open applications. Release the [Alt] key to open the selected application.
Ctrl + Shift + P. Play selected item.
2. CTRL+SHIFT+L – Turn on/ off filters.
Set the form's KeyPreview
property to true
, override the form's OnKeyDown
(or OnKeyUp
) method, and put in the following code: (Untested)
protected override void OnKeyDown(KeyEventArgs e) {
base.OnKeyDown(e);
if (e.Alt && e.KeyCode > '0' && e.KeyCode <= '9') {
tabControl.SelectedIndex = (int)(e.KeyCode - '1');
e.Handled = true;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With