TdxColorEdit Class
An unbound editor that allows users to select a color in a drop-down window.
Declaration
TdxColorEdit = class(
TdxCustomColorEdit
)
Remarks
TdxColorEdit allows users to select colors from a palette in a drop-down window.

Available Colors
Use the Properties.ColorPalette and Properties.ColorSet properties to switch between color sets available for selection in a drop-down window.

Custom Colors
To populate the drop-down gallery with custom colors, you must:
- Ensure that the Properties.ColorPalette property is set to cpOffice.
- Set the Properties.ColorSet property to csCustom.
Handle the Properties.OnGetCustomColorSet event.

UI Automation/Accessibility Support
The color editor is mapped to a node in the UI Automation tree when the global UI Automation flag (dxUIAutomationEnabled) is enabled.
UI Automation Settings
Use the Properties.Automation.Name and Properties.Automation.Description properties to specify the editor’s name and an optional description that clarifies the editor’s purpose for users who rely on third-party assistive tools (such as Microsoft Narrator).
Refer to the TdxAutomationElementSettings class description for detailed information on all available options.
Keyboard Interaction Options
The color editor supports the following keystrokes:
- Alt + ↑ | Alt + ↓
- Display the drop-down color gallery.
- F4
- Displays or hides the drop-down window without editor value changes.
- Esc
- Hides the drop-down window without editor value changes.
- ↑ | ↓ | ← | →
- Move focus by one position in the corresponding direction when the drop-down color gallery is displayed, set the focused color as the new editor value, and close the drop-down window.
Main API Members
The list below outlines key members of the TdxColorEdit class.
Appearance Settings
- Style | StyleDisabled | StyleFocused | StyleHot | StyleReadOnly
Allow you to define individual appearance settings for different editor states.
Tip
To apply the same style settings to multiple editors, use a TcxEditStyleController component. If you need to apply the same style settings to all editors in your application, you can use a TcxDefaultEditStyleController component.
- Styles
- Provides access to individual styles applied to the editor in different states.
- Transparent
- Specifies if the editor is transparent in GDI render mode.
Content-Related APIs
- ColorValue
- Specifies the selected color.
- OnEditing
- Allows you to prevent users from activating the editor.
Editor Settings and Repository Items
- ActiveProperties
- Provides access to the current editor settings regardless of their source. This property set does not allow you to customize editor settings.
- Properties
- Allows you to customize editor settings directly if the editor does not have an assigned repository item.
- RepositoryItem
- Specifies a repository item as an external source of editor settings. A repository item takes precedence over other editor settings.
General-Purpose API Members
- Enabled
- Specifies if the editor is enabled.
- CanModify
- Indicates if the editor is in read-only mode.
- IsEditValidating | IsHiding | IsPosting
- Allow you to identify the current operation in the editor.
- ShowHint
- Specifies if the standalone editor can display hints. To enable hints for an in-place editor in a container control, set its
OptionsBehavior.CellHints[1] property toTrue. - Width | Height
- Allow you to explicitly define editor dimensions.
Repository Item Class
You can create a TcxEditRepositoryColorEdit component in a TcxEditRepository to define an unbound color editor, store editor settings, and share them between multiple color editors.
Related Compiled Demo
To see the TdxColorEdit component in action, run the Data Editors and Controls demo in the VCL Demo Center installed with compiled DevExpress VCL demos. Click the Color Editor item in the sidebar to run the corresponding demo.
Compiled DevExpress demos ship with source code installed in the Public Documents folder (%PUBLIC%) for all users (default). You can find all project and source code files for the Data Editors and Controls demo in the following folder:
%PUBLIC%\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressEditors\
Tip
Project and source code files for all compiled DevExpress VCL Demos are maintained in a public repository hosted on GitHub:
Inheritance
-
Set the following behavior properties to
TrueorFalseto enable or disable in-place editor hints in corresponding container controls:- A Data Grid Table View’s OptionsBehavior.CellHints property.
- A Tree List control’s OptionsBehavior.CellHints property.
- A Vertical Grid control’s OptionsBehavior.CellHints property.