Skip to main content

EditorButton.ImageLocation Property

Specifies the position of the button’s image relative to the text.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[Browsable(false)]
[DefaultValue(ImageLocation.MiddleCenter)]
[DXCategory("Appearance")]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual ImageLocation ImageLocation { get; set; }

Property Value

Type Default Description
ImageLocation MiddleCenter

A ImageLocation value that specifies the alignment of the button’s image relative to the text.

Available values:

Name Description
Default

The same as MiddleLeft.

TopCenter

The image is vertically aligned at the top, and horizontally aligned in the center.

TopLeft

The image is vertically aligned at the top, and horizontally aligned on the left.

TopRight

The image is vertically aligned at the top, and horizontally aligned on the right.

MiddleCenter

The image is centered vertically and horizontally. The control’s text is not displayed in this mode.

MiddleLeft

The image is vertically centered, and horizontally aligned on the left.

MiddleRight

The image is vertically centered, and horizontally aligned on the right.

BottomCenter

The image is vertically aligned at the bottom, and horizontally aligned in the center.

BottomLeft

The image is vertically aligned at the bottom, and horizontally aligned on the left.

BottomRight

The image is vertically aligned at the bottom, and horizontally aligned on the right.

Remarks

A button can display text and an image at the same time. The ImageLocation property allows you specify the image position relative to the text.

The button’s text is specified by the EditorButton.Caption property. Text is displayed in the button if the EditorButton.Kind property is set to Glyph, Ellipsis, Delete, OK, Plus, Minus, Redo, Undo or DropDown.

A button can display either a custom image or a predefined image. To display a custom image, set the EditorButton.Kind property to Glyph and specify the image using the EditorButton.Image property. If the EditorButton.Kind property is set to any other value except Glyph, a corresponding predefined image is displayed.

If the button displays a custom or predefined image, and the ImageLocation property is set to MiddleCenter, the button’s text is hidden and the image is centered.

The ImageLocation property is equivalent to the ImageOptions.ImageLocation property (see EditorButton.ImageOptions).

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ImageLocation 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