dimanche 10 mai 2015

how to navigate between tabitem with Left and Right Key in WPF

hi everybody I want used shortcut key (using left and right key) in wpf and tabcontrol to navigation between tabitem I set code in Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)

like this:

switch (e.Key)
            {
                case Key.Right:
                    if (tbControl.TabIndex == 0)
                        tbControl.TabIndex = 1;
                    break;

                case Key.Left:
                    if (tbControl.TabIndex == 0)
                        tbControl.TabIndex = 1;
                    break;
            }

but it's not do anything I want navigation between tabitem with left and right key thanks

Aucun commentaire:

Enregistrer un commentaire