[]
Visual styles can be applied to the C1ColorPicker control using VisualStyle property. The smart tag on the top right corner of C1ColorPicker control lets users select the visual style they want to apply on the color picker.
Complete the following steps:
) to open the C1ColorPicker Tasks menu.The code snippets refer the color picker application created in Working with C1ColorPicker.
Add the ComboBox control to the form.
Add the following line of code to the application to get the visual styles in the ComboBox:
InitializeComponent()
ComboBox1.DataSource = [Enum].GetValues(GetType(VisualStyle))
InitializeComponent();
comboBox1.DataSource = Enum.GetValues(typeof(VisualStyle));
Add code to the comboBox1_SelectedIndexChanged event handler so that the visual style of C1ColorPicker is updated on selecting an option from the combo box listing the available visual styles:
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
C1ColorPicker1.VisualStyle = DirectCast(ComboBox1.SelectedItem, VisualStyle)
End Sub
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
c1ColorPicker1.VisualStyle = (VisualStyle)comboBox1.SelectedItem;
}
Run the application.
Now you can select the visual style from the drop down of the combo box and set the visual style of the C1ColorPicker. The following image shows the output: