Skip to main content
A newer version of this page is available. .

ColorEdit Class

Represents a color editor.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v18.2.dll

Declaration

public class ColorEdit :
    BaseEdit,
    IColorEdit

Remarks

The ColorEdit editor allows an end-user to choose colors from the RGBA color space.

ColorEdit

Its features include:

  • 20 Preset Palettes - Apex, Civic, Grayscale, Office, etc.
  • Recent Colors Palette - includes custom colors which can be added via the More Colors dialog.
  • Unlimited Number of Custom Color Palettes - by default, the editor displays three color palettes: Theme Colors, Gradient Theme Colors and Standard Colors. You can replace default palettes or add any number of custom color palettes. To create a color palette, create a new instance of the CustomPalette class and define the colors. Use the static ColorPalette.CreateGradientPalette method to create a palette with gradient colors. To display a custom palette within the editor, add it to the ColorEdit.Palettes collection.
  • Configurable Palette Layout - you can manually specify the number of color columns using the ColorEdit.ColumnCount property. Alternatively, the number of columns is automatically calculated.
  • Customizable Default Color - you can specify the default color, which is applied by clicking the Default Color Button. To do this, use the ColorEdit.DefaultColor property.
  • Optional Empty Color - to allow an end-user to select an empty color (ColorEdit.EmptyColor), set the ColorEdit.ShowNoColorButton property to true. This shows the No Color Button within the editor.
  • Localizable UI

Example

This example shows how to create custom palettes and display them within a ColorEdit control.

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Windows

Namespace DXEditors_ColorEdit
    ''' <summary>
    ''' Interaction logic for App.xaml
    ''' </summary>
    Partial Public Class App
        Inherits Application
    End Class
End Namespace

The following code snippets (auto-collected from DevExpress Examples) contain references to the ColorEdit class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also