Exemple #1
0
        protected void LoadTheme(Label Titulo = null, Label SubTitulo = null, Label SubTitulo2 = null)
        {
            foreach (Control control in this.Controls)
            {
                Button button; IconButton iconButton; IconPictureBox iconPictureBox; DataGridView dataGridView;
                if (control.GetType() == typeof(Button))
                {
                    button           = (Button)control;
                    button.BackColor = ThemeColor.Primary;
                    button.ForeColor = ThemeColor.ChangeColorBrightness(ThemeColor.Secondary, -0.5);
                    button.FlatAppearance.BorderColor = ThemeColor.Secondary;
                }
                if (control.GetType() == typeof(IconButton))
                {
                    iconButton           = (IconButton)control;
                    iconButton.BackColor = ThemeColor.Primary;
                    iconButton.ForeColor = ThemeColor.ChangeColorBrightness(ThemeColor.Secondary, -0.5);
                    iconButton.FlatAppearance.BorderColor = ThemeColor.Secondary;
                    iconButton.IconColor = ThemeColor.Secondary;
                }
                if (control.GetType() == typeof(IconPictureBox))
                {
                    iconPictureBox           = (IconPictureBox)control;
                    iconPictureBox.BackColor = ThemeColor.Primary;
                    iconPictureBox.ForeColor = ThemeColor.ChangeColorBrightness(ThemeColor.Secondary, -0.5);
                    iconPictureBox.IconColor = ThemeColor.Secondary;
                }
                if (control.GetType() == typeof(DataGridView))
                {
                    dataGridView = (DataGridView)control;
                    dataGridView.RowsDefaultCellStyle.SelectionBackColor = ThemeColor.ChangeColorBrightness(ThemeColor.Secondary, -0.5);

                    dataGridView.RowsDefaultCellStyle.BackColor            = ThemeColor.Primary;
                    dataGridView.AlternatingRowsDefaultCellStyle.BackColor = ThemeColor.ChangeColorBrightness(ThemeColor.Primary, -0.2);

                    dataGridView.RowHeadersDefaultCellStyle.BackColor = ThemeColor.ChangeColorBrightness(ThemeColor.Primary, -0.5);

                    dataGridView.ColumnHeadersDefaultCellStyle.BackColor          = ThemeColor.ChangeColorBrightness(ThemeColor.Primary, -0.5);
                    dataGridView.ColumnHeadersDefaultCellStyle.SelectionBackColor = ThemeColor.ChangeColorBrightness(ThemeColor.Primary, -0.5);
                }
            }
            if (Titulo != null)
            {
                Titulo.ForeColor = ThemeColor.Secondary;
            }
            if (SubTitulo != null)
            {
                SubTitulo.ForeColor = ThemeColor.Primary;
            }
            if (SubTitulo2 != null)
            {
                SubTitulo2.ForeColor = ThemeColor.Primary;
            }
        }
Exemple #2
0
 private void ActiveButton(object btnSender)
 {
     if (btnSender != null)
     {
         if (currentButton != (Button)btnSender)
         {
             DisableButton();
             currentButton           = (Button)btnSender;
             currentButton.BackColor = ThemeColor.ChangeColorBrightness(pnlManagementMenu.BackColor, +0.2);
             currentButton.ForeColor = Color.White;
         }
     }
 }
Exemple #3
0
 private void ActiveButton(object btnSender)
 {
     if (btnSender != null)
     {
         if (currentBtnCategory != (Button)btnSender)
         {
             DisableButton();
             currentBtnCategory = (Button)btnSender;
             Color color = SelectThemeColor();
             currentBtnCategory.BackColor = color;
             currentBtnCategory.ForeColor = Color.White;
             currentBtnCategory.Font      = new System.Drawing.Font("Microsoft Sans Serif", 12.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             panelLogo.BackColor          = ThemeColor.ChangeColorBrightness(color, -0.3);
             panelTitle.BackColor         = color;
             lbTitle.Text = currentBtnCategory.Text;
         }
     }
 }
Exemple #4
0
 private void ActivateButton(object btnSender)
 {
     if (btnSender != null)
     {
         if (currentButton != (Button)btnSender)
         {
             DisableButton();
             Color color = SelectThemeColor();
             currentButton             = (Button)btnSender;
             currentButton.BackColor   = color;
             currentButton.ForeColor   = Color.White;
             currentButton.Font        = new System.Drawing.Font("Microsoft Sans Serif", 12.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             panelTitleBar.BackColor   = color;
             ThemeColor.PrimaryColor   = color;
             ThemeColor.SecondaryColor = ThemeColor.ChangeColorBrightness(color, -0.3);
         }
     }
 }
Exemple #5
0
 //Kích Hoạt Nút Bấm - Có Đổi Màu
 private void ActivateButton(object btnSender)
 {
     if (btnSender != null)
     {
         if (currentButton != (Button)btnSender)
         {
             DisableButton();
             Color color = SelectThemeColor();
             currentButton             = (Button)btnSender;
             currentButton.BackColor   = color;
             currentButton.ForeColor   = Color.White;
             currentButton.Font        = new Font("Monotype Corsiva", 24F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             panelTitleBar.BackColor   = color;
             panelLogo.BackColor       = ThemeColor.ChangeColorBrightness(color, -0.3);
             ThemeColor.PrimaryColor   = color;
             ThemeColor.SecondaryColor = ThemeColor.ChangeColorBrightness(color, -0.3);
         }
     }
 }
Exemple #6
0
 private void ActivateButton(object btnSender)
 {
     if (btnSender != null)
     {
         if (currentButton != (Button)btnSender)
         {
             DisableButton();
             Color color = SelectThemeColor();
             currentButton             = (Button)btnSender;
             currentButton.BackColor   = color;
             currentButton.ForeColor   = Color.White;
             currentButton.Font        = new System.Drawing.Font("Elianto", 15.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             panelTitleBar.BackColor   = color;
             panelLogo.BackColor       = ThemeColor.ChangeColorBrightness(color, -0.3);
             ThemeColor.PrimaryColor   = color;
             ThemeColor.SecondaryColor = ThemeColor.ChangeColorBrightness(color, -0.3);
             btnCloseChildForm.Visible = true;
         }
     }
 }