Event Handling in Windows Forms ColorUI
1 Oct 2018 / 1 minute to read
ColorSelected Event
This event is handled when a color of a Color Group is selected. The below example closes the ColorUI displayed in a Popup Menu using this event.
In the ColorSelected event, the following coding ensures that the popupControlContainer containing the ColorUI Control closes a color is selected.
private void colorUIControl_ColorSelected(object sender, System.EventArgs e)
{
// Ensures that the PopupControlContainer is closed after the selection of a color.
Syncfusion.Windows.Forms.ColorUIControl cuicontrol = sender as Syncfusion.Windows.Forms.ColorUIControl;
Syncfusion.Windows.Forms.PopupControlContainer pcc = cuicontrol.Parent as Syncfusion.Windows.Forms.PopupControlContainer;
pcc.HidePopup(Syncfusion.Windows.Forms.PopupCloseType.Done);
}
Private Sub colorUIControl_ColorSelected(ByVal sender As Object, ByVal e As System.EventArgs)
' Ensures that the PopupControlContainer is closed after the selection of a color.
Private cuicontrol As Syncfusion.Windows.Forms.ColorUIControl = CType(IIf(TypeOf sender Is Syncfusion.Windows.Forms.ColorUIControl, sender, Nothing), Syncfusion.Windows.Forms.ColorUIControl)
Private pcc As Syncfusion.Windows.Forms.PopupControlContainer = CType(IIf(TypeOf cuicontrol.Parent Is Syncfusion.Windows.Forms.PopupControlContainer, cuicontrol.Parent, Nothing), Syncfusion.Windows.Forms.PopupControlContainer)
pcc.HidePopup(Syncfusion.Windows.Forms.PopupCloseType.Done)
End Sub
See Also
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page