public static void ChangeTheme() { // determine which argb collection should be used MainWindow.ColorTheme colorTheme = (MainWindow.ColorTheme)Config.MainWindow.ColorThemeBox.SelectedIndex; switch (colorTheme) { case MainWindow.ColorTheme.Light: Config.ChangeTheme(Themes.Light); break; case MainWindow.ColorTheme.Dark: Config.ChangeTheme(Themes.Dark); break; } }
private void RootToolStripMenuItem_DropDownClosed(object sender, EventArgs e) { // store selected color theme MainWindow.ColorTheme colorTheme = (MainWindow.ColorTheme) this.colorThemeBox.SelectedIndex; // if color theme is dark if (colorTheme == MainWindow.ColorTheme.Dark) { // change font color back to the dark theme's default ToolStripMenuItem myItem = (ToolStripMenuItem)sender; if (myItem != null) { myItem.ForeColor = Themes.Dark.Font.GetColor(); } } }
private void RootToolStripMenuItem_DropDownOpening(object sender, EventArgs e) { // store selected color theme MainWindow.ColorTheme colorTheme = (MainWindow.ColorTheme) this.colorThemeBox.SelectedIndex; // if color theme is dark if (colorTheme == MainWindow.ColorTheme.Dark) { // change font color temporarily (for visibility) ToolStripMenuItem myItem = (ToolStripMenuItem)sender; if (myItem != null) { myItem.ForeColor = Themes.Light.Font.GetColor(); } } }