New to Telerik UI for WinForms? Download free 30-day trial

Properties

Property Description
ColorDialog Gets the RadColorDialog of this control.
ColorBoxElement Gets the RadColorBoxElement of this control.
Value Gets or sets the value of the editor.
ReadOnly Determines if users can input text directly into the text field..
TabStop Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.

Events

Event Description
DialogClosed Fires after the color dialog is closed.
ValueChanging Fires right before the value is changed, can be canceled.
ValueChanged Fires after the editor value is changed.

The ValueChanging event fires before the value is changed and allows you to prevent the change. The event passes a ValueChangingEventArgs parameter that includes the OldValue, NewValue and Cancel properties. Set Cancel to true to prevent the change. The example below cancels the value changing if the new value is not a named color:

Cancel ValueChanging.

private void radColorBox1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e)
{
    e.Cancel = !((Color)e.NewValue).IsNamedColor;
}

Private Sub RadColorBox1_ValueChanging(sender As Object, e As Telerik.WinControls.UI.ValueChangingEventArgs)
    e.Cancel = Not DirectCast(e.NewValue, System.Drawing.Color).IsNamedColor
End Sub

See Also

In this article