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

RepositoryItemColorEdit.ColorAlignment Property

Specifies the alignment of the preview color box within the control’s edit region.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(HorzAlignment.Near)]
public HorzAlignment ColorAlignment { get; set; }

Property Value

Type Default Description
HorzAlignment **Near**

A HorzAlignment value specifying the alignment of the preview color box within the control’s edit region.

Available values:

Name Description
Default

Places an object or text at the default position, which is determined by a control.

Near

Places an object/text at a near position.

Center

Centers an object or text within a region.

Far

Places an object/text at a far position.

Remarks

The ColorAlignment property controls the alignment of the preview color box and text within the control’s edit region. You can align the color box to the left, right or center it. If the color box is centered, the color text is not displayed.

The following table shows how ColorAlignment affects the edit box.

ColorAlignment value

Image

HorzAlignment.Default

The color box is not displayed. The color text is aligned to the left.

ColorEdit_ColorAlignment_Default

HorzAlignment.Near

The color box and text are aligned to the left.

ColorEdit_ColorAlignment_Near

HorzAlignment.Center

Only the color box is displayed and it is centered within the edit box.

ColorEdit_ColorAlignment_center

HorzAlignment.Far

The color box is aligned to the right and the color text is aligned to the left.

ColorEdit_ColorAlignment_Far

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

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