in tools/Explorer/TabControl/TabControl.cs [451:506]
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
var tabsCount = GetTabsCount();
if (tabsCount == 0)
return;
TabItem ti = null;
switch (e.Key)
{
//case Key.Home:
// ti = GetTabItem(0);
// break;
//case Key.End:
// ti = GetTabItem(tabsCount - 1);
// break;
case Key.Tab:
if (e.KeyboardDevice.Modifiers == ModifierKeys.Control)
{
var index = SelectedIndex;
var direction = e.KeyboardDevice.Modifiers == ModifierKeys.Shift ? -1 : 1;
while (true)
{
index += direction;
if (index < 0)
index = tabsCount - 1;
else if (index > tabsCount - 1)
index = 0;
FrameworkElement ui = GetTabItem(index);
if (ui != null)
{
if (ui.Visibility == Visibility.Visible && ui.IsEnabled)
{
ti = GetTabItem(index);
break;
}
}
}
}
break;
}
TabPanel panel = Helper.FindVirtualizingTabPanel(this);
if (panel != null && ti != null)
{
panel.MakeVisible(ti, Rect.Empty);
SelectedItem = ti;
e.Handled = ti.Focus();
}
base.OnPreviewKeyDown(e);
}