Back to Devexpress

ColorEdit Class

windowsforms-devexpress-dot-xtraeditors-71f6f69a.md

latest4.7 KB
Original Source

ColorEdit Class

The editor that allows you to select a color from a dropdown window.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultBindingPropertyEx("Color")]
public class ColorEdit :
    PopupBaseEdit
vb
<DefaultBindingPropertyEx("Color")>
Public Class ColorEdit
    Inherits PopupBaseEdit

The following members return ColorEdit objects:

Remarks

The ColorEdit class encapsulates a color editor which enables the end-user to select a color from the dropdown window. The dropdown contains three tabbed pages displaying predefined custom, web and system colors.

The following image shows a color editor with a color selected from the Web panel.

By default, the editor contains 16 predefined colors in the Custom panel.

If the RepositoryItemColorEdit.ShowColorDialog property is set to true , the end-user is able to define and edit these colors by right-clicking the corresponding color box. In this case, the standard color dialog is activated and this enables you to select a color and add it to the Custom panel. Non- custom colors cannot be changed by right-clicking the color box.

To specify custom colors at design time or via code, see the RepositoryItemColorEdit.CustomColors property.

To select a particular color, left-click it with the mouse.

The color currently selected can be specified via the ColorEdit.EditValue or ColorEdit.Color properties. These properties can be used interchangeably, and they only differ by the type of the return value. ColorEdit.Color returns the selected color as a Color structure, while edit value returns the selected value either as an integer or Color value, depending on the RepositoryItemColorEdit.StoreColorAsInteger property value.

See the editor’s ColorEdit.Properties property to customize the editor’s appearance and behavior.

To create a color editor as an in-place control for XtraGrid, for instance, you need to create a RepositoryItemColorEdit object. The repository item should then be assigned to the appropriate column. The grid control creates an in-place editor as required, based on the settings of the repository item assigned to the column.

Implements

IXtraResizableControl

Inheritance

Show 14 items

Object MarshalByRefObject Component Control DevExpress.XtraEditors.XtraControl ControlBase BaseControl BaseEdit TextEdit ButtonEdit PopupBaseEdit ColorEdit ColorPickEditBase

ColorPickEdit

See Also

ColorEdit Members

ColorPickEdit

DevExpress.XtraEditors Namespace