The RibbonColorPicker has two sections the theme colors and the standard colors:
You can change the theme colors by modifying the OfficeColorPalette property through the Properties window or programmatically.
You can change the OfficeColorPalette property using the Properties window. Add a color picker to the Ribbon group, and then click the color picker item to reveal the RibbonColorPicker properties in the Properties window. Locate the OfficeColorPalette property's drop-down arrow and select the new color theme from the list, for example, Metro:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
' type the Imports directive for the namespace Imports C1.Win.C1Ribbon Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ColorPicker As RibbonColorPicker = New RibbonColorPicker() ' add a color picker to the group RibbonGroup1.Items.Add(ColorPicker) ' add the FontColor image to your Resources folder ' set the image for the color picker ColorPicker.SmallImage = Properties.Resources.FontColor ' set the theme color for the color picker ColorPicker.OfficeColorPalette = Office2007ColorThemes.Metro End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
// type the using directive for the namespace using C1.Win.C1Ribbon; private void Form1_Load(object sender, System.EventArgs e) { RibbonColorPicker ColorPicker = new RibbonColorPicker(); // add a color picker to the group ribbonGroup1.Items.Add(ColorPicker); // add the FontColor image to your Resources folder // set the image for the color picker ColorPicker.SmallImage = Properties.Resources.FontColor; // set the theme color for the color picker ColorPicker.OfficeColorPalette = Office2007ColorThemes.Metro; } |
Run the application, and click the color picker. The new color theme is visible under the Theme Colors section: