# Setting the Palette

## Content

**ColorPicker for WPF** includes over 20 predefined color palettes that match the themes used in Microsoft Office. For more information about palette choices, see [Available ColorPicker Palettes](/componentone/docs/wpf/online-colorpicker5/working-with-colorpicker/AvailableColorPickerPalettes). To change the color palette, you can set the [C1ColorPicker.Palette](/componentone/api/wpf/online-colorpicker5/dotnet-api/C1.WPF.ColorPicker/C1.WPF.ColorPicker.C1ColorPicker.Palette.html) property.

To set the **C1ColorPicker.Palette** property, complete the following steps:

1. Navigate to the Toolbox and double-click the **Button** icon to add the control to the project.
2. Resize and reposition the **Button** on the form.
3. Navigate to the Properties window and set the button’s **Content** property to **Change Palette**.
4. Double-click the button to switch to Code view and create the **Button\_Click** event handler.
5. Add code for the **Button\_Click** event handler, so it appears like the following: 

    ```csharp
    private void button1_Click(object sender, System.Windows.RoutedEventArgs e)
    {
        // Change color palette.
        this.c1ColorPicker.Palette = ColorPalette.GetColorPalette(Office2007ColorTheme.GrayScale);
    }
    ```

    ```vbnet
    Private Sub Button1_Click(ByVal sender as Object, ByVal e as System.Windows.RoutedEventArgs)
        ' Set the color palette.
        Me.C1ColorPicker.Palette = ColorPalette.GetColorPalette(Office2007ColorTheme.GrayScale)
    End Sub
    ```
6. The **C1ColorPicker's** color palette will now change to grayscale when the button is clicked.

Run the application and observe the following:

1. Click the **C1ColorPicker** control's drop-down arrow and notice that the default palette appears.
2. Click the Change Palette button and click the **C1ColorPicker** control's drop-down arrow once again. Notice that a grayscale palette appears:

![](https://cdn.mescius.io/document-site-files/images/cffeaa03-6a9f-4bf4-a1f4-c4c15266c18f/colorpicker_images/setpalette.png)