Skip to content

Commit e1d1a2e

Browse files
committed
Focus on new/opened tab
1 parent a8ee050 commit e1d1a2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

MathInterpreter/MainWindow.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private void MainWindow_OnClosed(object sender, EventArgs e)
2626
private void NewFile_OnClick(object sender, RoutedEventArgs e)
2727
{
2828
TabControl.Items.Add(new MathTab());
29+
SelectNewTab();
2930
}
3031

3132
private void OpenFile_OnClick(object sender, RoutedEventArgs e)
@@ -36,6 +37,7 @@ private void OpenFile_OnClick(object sender, RoutedEventArgs e)
3637
return;
3738

3839
TabControl.Items.Add(tab);
40+
SelectNewTab();
3941
}
4042

4143
private void SaveFile_OnClick(object sender, RoutedEventArgs e)
@@ -77,5 +79,10 @@ private void Settings_OnClick(object sender, RoutedEventArgs e)
7779
{
7880
SettingsWindow.Open();
7981
}
82+
83+
private void SelectNewTab()
84+
{
85+
TabControl.SelectedIndex = TabControl.Items.Count - 1;
86+
}
8087
}
8188
}

0 commit comments

Comments
 (0)