windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-editorbutton-dd1110b5.md
Gets or sets a custom image to display on the button.
Namespace : DevExpress.XtraEditors.Controls
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Browsable(false)]
[DefaultValue(null)]
[DXCategory("Appearance")]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Image Image { get; set; }
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<DefaultValue(Nothing)>
<DXCategory("Appearance")>
Public Overridable Property Image As Image
| Type | Default | Description |
|---|---|---|
| Image | null |
A Image object that specifies the image displayed on the button surface.
|
A button can display either a custom image or predefined glyphs. The custom image is displayed if the button’s kind specified by the EditorButton.Kind property is set to ButtonPredefines.Glyph. Otherwise, the button displays a predefined image depending upon the current value of the EditorButton.Kind property.
You can display a caption near the button’s image. For this purpose, set the EditorButton.Caption property.
To align the image relative to the button’s caption, use the EditorButton.ImageOptions.ImageToTextAlignment property.
When the Image property value is changed, the button’s EditorButton.Changed event is fired.
The Image property is equivalent to the ImageOptions.Image property (see EditorButton.ImageOptions).
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Image 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.
winforms-create-data-bound-imagecombobox/CS/Form1.cs#L61
button.Visible = !(selectedImage == null);
button.Image = selectedImage;
}
winforms-create-data-bound-imagecombobox/VB/Form1.vb#L52
button.Visible = Not selectedImage Is Nothing
button.Image = selectedImage
End Sub
See Also