Articles in this section
Category / Section

How to get the colorGroup for selected item in WinForms ColorPicker?

1 min read

In the WinForms ColorPicker, you can get the color group for the selected item by using the Picked event handler. The property, ActiveGroup helps to get the color group of the selected item in the ColorPickerUIAdv.

 

The following code example demonstrates the same.

C#

//The event is raised when the ColorItem is picked.
this.colorPickerUIAdv1.Picked += new Syncfusion.Windows.Forms.Tools.ColorPickerUIAdv.ColorPickedEventHandler(colorPickerUIAdv1_Picked);
void colorPickerUIAdv1_Picked(object sender, Syncfusion.Windows.Forms.Tools.ColorPickerUIAdv.ColorPickedEventArgs args)
{
    // Gets the color group of the selected item.
    MessageBoxAdv.Show(this.colorPickerUIAdv1.ActiveGroup.Name, "Selected ColorGroup");
}

VB

'The event is raised when the ColorItem is picked.
AddHandler colorPickerUIAdv1.Picked, AddressOf colorPickerUIAdv1_Picked
Private Sub colorPickerUIAdv1_Picked(ByVal sender As Object, ByVal args As Syncfusion.Windows.Forms.Tools.ColorPickerUIAdv.ColorPickedEventArgs)
 ' Gets the color group of the selected item
 MessageBoxAdv.Show(Me.colorPickerUIAdv1.ActiveGroup.Name, "Selected ColorGroup")
End Sub

 

ColorItem selected on Theme Colors group

Figure 1: ColorItem selected on the Theme Colors

 

ColorItem selected on Standard Colors group

Figure 2: ColorItem selected on the Standard Colors

 

ColorItem selected on Recent Colors group

Figure 3: ColorItem selected on the Recent Colors

Sample Links:

C#: https://www.syncfusion.com/downloads/support/directtrac/110822/ze/ColorPickerUIAdv_ColorGroup-308156716

VB: https://www.syncfusion.com/downloads/support/directtrac/110822/ze/ColorPickerUIAdv_ColorGroup_VB-408967402



Conclusion

I hope you enjoyed learning how get the colorGroup for selected item in WinForms ColorPicker.

You can refer to WinForms Color Picker feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms Cuolor Picker example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied