private void ChangeTheme(int theme) { this.BackColor = Temas.GetPrimaryColor(theme); foreach (Panel v in separators) { v.BackColor = Temas.GetSecondaryColor(theme); } foreach (TabPage v in tabPages) { v.BackColor = Temas.GetPrimaryColor(theme); v.ForeColor = Temas.GetFontColor(theme); } foreach (Button v in buttons) { v.BackColor = Temas.GetSecondaryColor(theme); v.ForeColor = Temas.GetFontColor(theme); } foreach (TextBox v in textBoxes) { v.BackColor = Temas.GetPrimaryColor(theme); v.ForeColor = Temas.GetFontColor(theme); } foreach (Label v in labels) { v.BackColor = Temas.GetPrimaryColor(theme); v.ForeColor = Temas.GetFontColor(theme); } foreach (CheckBox v in checkBoxes) { v.BackColor = Temas.GetPrimaryColor(theme); v.ForeColor = Temas.GetFontColor(theme); } }
private void ChangeTheme(int theme, bool alterTheme) //Alterar tema do programa { myText.ForeColor = Temas.GetFontColor(theme); myText.BackColor = Temas.GetPrimaryColor(theme); menu_main.ForeColor = Temas.GetFontColor(theme); menu_main.BackColor = Temas.GetSecondaryColor(theme); sep_topBorder.BackColor = Temas.GetTopBorderColor(theme); menu_main.Renderer = new MyRenderer(theme); //Adicionando novo renderer int[] formSize = new int[2] { this.Width, this.Height }; toolStripThemes[this.theme].Checked = false; //Remove Checked do tema anterior this.theme = theme; foreach (ToolStripMenuItem v in allToolStrip) { //Console.WriteLine(v.BackColor); v.ForeColor = Temas.GetFontColor(theme); for (int i = 0; i < v.DropDownItems.Count; i++) { v.DropDownItems[i].BackColor = Temas.GetSecondaryColor(theme); v.DropDownItems[i].ForeColor = Temas.GetFontColor(theme); } //Console.WriteLine(v.BackColor); } for (int i = 0; i < toolStripThemes.Count; i++) { toolStripThemes[i].BackColor = Temas.GetSecondaryColor(theme); toolStripThemes[i].ForeColor = Temas.GetFontColor(theme); } toolStripThemes[theme].Checked = true; if (alterTheme == true) { Temas.SaveConfig(theme, myText.Font.FontFamily.Name, myText.Font.Size, formSize, Temas.InitialDirectory); } }