ComponentOne ColorPicker for WPF
C1ColorPicker Task-Based Help / Changing the Background Color
In This Topic
    Changing the Background Color
    In This Topic

    The Background property gets or sets the value of the C1ColorPicker control's background color. This property can be used from the System.Windows.Controls namespace to set the background color of the C1ColorPicker control, in XAML, and in code.

    At Design Time

    To set the Background property at run time, complete the following steps:

    1. Click the C1ColorPicker control once to select it.
    2. Navigate to the Properties window, and click the Background drop-down arrow, and choose Red or another color in the color picker.

    In XAML

    For example, to set the Background property to Red add Background="Red" to the <c1: C1ColorPicker> tag so that it appears similar to the following:

    XAML
    Copy Code
    <c1:C1ColorPicker Name="C1ColorPicker1" Background="Red" Margin="296,98,273,0" Height="45" VerticalAlignment="Top"/>
    

    In Code

    For example, to set the Background property to Red, add the following code to your project:

    this.c1ColorPicker1.Background = System.Windows.Media.Brushes.Red;
    
    Me.C1ColorPicker1.Background = System.Windows.Media.Brushes.Red
    

    Run the application and observe:

    The background of the C1ColorPicker control will appear red: