Extended Library for WPF and Silverlight | ComponentOne
ColorPicker / 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. By default the C1ColorPicker control starts with the Background property unset, but you can customize this at design time, in XAML, and in code.

    At Design Time in Blend

    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" Margin="296,98,273,0" Height="45" VerticalAlignment="Top" Background="Red"/>
    

     

    In Code

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

    Visual Basic
    Copy Code
    Me.C1ColorPicker1.Background = System.Windows.Media.Brushes.Red
    

     

    C#
    Copy Code
    this.c1ColorPicker1.Background = System.Windows.Media.Brushes.Red;
    

     

    Run the application and observe:

    The background of the C1ColorPicker control will appear red: