コード例 #1
0
 private void SetTheme(Office2007Theme theme, int r, int g, int b, int r1, int g1, int b1)
 {
     foreach (BarItem i in this.visualStyleParentBarItem.Items)
     {
         i.Checked = false;
     }
     this.office2016ParentBarItem.Checked      = true;
     this.calculatorControl1.ButtonStyle       = ButtonAppearance.Office2007;
     this.calculatorControl1.Office2007Theme   = theme;
     this.mainFrameBarManager1.Style           = VisualStyle.Office2007;
     this.mainFrameBarManager1.Office2007Theme = theme;
     this.gradientPanel1.BackgroundColor       = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.Color.FromArgb(((System.Byte)(r1)), ((System.Byte)(g1)), ((System.Byte)(b1))), System.Drawing.Color.FromArgb(((System.Byte)(r)), ((System.Byte)(g)), ((System.Byte)(b))));
     this.calculatorControl1.BackgroundColor   = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.Color.FromArgb(((System.Byte)(r1)), ((System.Byte)(g1)), ((System.Byte)(b1))), System.Drawing.Color.FromArgb(((System.Byte)(r)), ((System.Byte)(g)), ((System.Byte)(b))));
     foreach (Control c in this.gradientPanel1.Controls)
     {
         if (c is GradientPanel)
         {
             GradientPanel panel = c as GradientPanel;
             panel.BackgroundColor = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.Color.FromArgb(((System.Byte)(r1)), ((System.Byte)(g1)), ((System.Byte)(b1))), System.Drawing.Color.FromArgb(((System.Byte)(r)), ((System.Byte)(g)), ((System.Byte)(b))));
             panel.BorderColor     = Color.FromArgb(r, g, b);
         }
         else if (c is GradientLabel)
         {
             GradientLabel label = c as GradientLabel;
             label.BackgroundColor = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.Color.FromArgb(((System.Byte)(r1)), ((System.Byte)(g1)), ((System.Byte)(b1))), System.Drawing.Color.FromArgb(((System.Byte)(r)), ((System.Byte)(g)), ((System.Byte)(b))));
         }
     }
 }
コード例 #2
0
        public void UpdateFormControlColors(Office2007Theme theme)
        {
            switch (theme)
            {
            case Office2007Theme.Blue:
                BrushInfo gradient = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(208, 226, 247), Color.FromArgb(237, 240, 247));
                this.gradientLabel1.BackgroundColor = gradient;
                this.gradientLabel2.BackgroundColor = gradient;
                this.gradientLabel3.BackgroundColor = gradient;
                this.gradientPanel1.BackgroundColor = gradient;
                break;

            case Office2007Theme.Black:
                BrushInfo gradient2 = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(181, 188, 198), Color.FromArgb(213, 221, 225));
                this.gradientLabel1.BackgroundColor = gradient2;
                this.gradientLabel2.BackgroundColor = gradient2;
                this.gradientLabel3.BackgroundColor = gradient2;
                this.gradientPanel1.BackgroundColor = gradient2;
                break;

            case Office2007Theme.Silver:
                BrushInfo gradient3 = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(214, 219, 231), Color.FromArgb(226, 231, 239));
                this.gradientLabel1.BackgroundColor = gradient3;
                this.gradientLabel2.BackgroundColor = gradient3;
                this.gradientLabel3.BackgroundColor = gradient3;
                this.gradientPanel1.BackgroundColor = gradient3;
                break;
            }
        }