)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to apply office color scheme to any control in the WinForms Office2007Form and Office2010Form?

Platform: WinForms |
Control: Office2007Form |
Published Date: June 17, 2015 |
Last Revised Date: January 7, 2020

Color schemes

The color scheme is applied in the Office2007Form and Office2010Form, by default and the color scheme cannot be applied to controls placed in the Form. So, it is required to specify the colors for the controls placed in the Form based on the color scheme. The color scheme of the Office2007Form can be applied by using the property, ColorScheme.

There are four different color schemes available in the Office2007Form.

  1. Blue
  2. Black
  3. Silver
  4. Managed

Managed color scheme helps to apply the user-defined colors. The Managed color scheme can be applied to the Office2007Form by using the function, ApplyManagedColors. Each and every item of the colors in the Office2007Form can be acquired by using the function, GetColorTable in the Office2007Colors.

C#

//Sets the color scheme as blue
this.ColorScheme = Office2007Theme.Blue;
//Changes the Back color of the GradientPanel to Office2007Blue
this.gradientPanel1.BackColor = Color.FromArgb(187, 212, 246);
//Sets the color scheme as black
this.ColorScheme = Office2007Theme.Black;
//Changes the Back color of the GradientPanel to Office2007Black
this.gradientPanel1.BackColor = Color.FromArgb(113, 113, 113);
//Sets the color scheme as silver
this.ColorScheme = Office2007Theme.Silver;
//Changes the Back color of the GradientPanel to Office2007Silver
this.gradientPanel1.BackColor = Color.FromArgb(202, 207, 217);
//Sets the managed color scheme for Office2007Form
this.ColorScheme = Office2007Theme.Managed;
//Applies the managed color to Office2007Form
Office2007Colors.ApplyManagedColors(this, Color.Red);
//Gets the form back color from the color table
Color color = Office2007Colors.GetColorTable(Office2007Theme.Managed).FormBackground;
//Changes the Back color of the GradientPanel to Managed color
this.gradientPanel1.BackColor = color;

VB

'Sets the color scheme as black
Me.ColorScheme = Office2007Theme.Black
'Changes the Back color of the GradientPanel to Office2007Black
Me.gradientPanel1.BackColor = Color.FromArgb(113, 113, 113)
'Sets the color scheme as blue
Me.ColorScheme = Office2007Theme.Blue
'Changes the Back color of the GradientPanel to Office2007Blue
Me.gradientPanel1.BackColor = Color.FromArgb(187, 212, 246)
'Sets the color scheme as silver
Me.ColorScheme = Office2007Theme.Silver
'Changes the Back color of the GradientPanel to Office2007Silver
Me.gradientPanel1.BackColor = Color.FromArgb(202, 207, 217)
'Sets the managed color scheme for Office2007Form
Me.ColorScheme = Office2007Theme.Managed
'Applies the managed color to Office2007Form
Office2007Colors.ApplyManagedColors(Me, System.Drawing.Color.Red)
'Gets the form back color from the color table
Dim color As Color = Office2007Colors.GetColorTable(Office2007Theme.Managed).FormBackground
'Changes the Back color of the GradientPanel to Managed color
Me.gradientPanel1.BackColor = color

 

Colorscheme is set as Blue

Figure 1: ColorScheme is set as Blue

Colorscheme is set as Black

Figure 2: ColorScheme is set as Black

Colorscheme is set as Silver

Figure 3: ColorScheme is set as Silver

Colorscheme is set as Managed

Figure 4: ColorScheme is set as Managed

Samples:

C#: http://www.syncfusion.com/downloads/support/forum/119261/ze/Office2007Form1557056153

VB: http://www.syncfusion.com/downloads/support/forum/119261/ze/Office2007Form_VB1447920667

Reference link: https://help.syncfusion.com/windowsforms/office2007form/color-schemes

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon