private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Index == 0) { Temas.Hide(); Colores.Show(); } else if (e.Node.Index == 1) { Colores.Hide(); Temas.Show(); } }
public static void AplicarTema(this Form1 form1, Temas tema) { form1.BackColor = tema.Form1_background; form1.ForeColor = tema.Form1_Foreground; var controles = GetAllControls(form1); foreach (Control control in controles) { if (!(control is TextBox) && !(control is VistaLista) && !(control is NumericUpDown) && !(control is Button) && !(control is ComboBox)) { if (control.BackColor == SystemColors.ControlLightLight || control.BackColor == Color.Transparent) { control.BackColor = SystemColors.ControlDark; } else { control.BackColor = tema.Form1_background; } control.ForeColor = tema.Form1_Foreground; } } }