Back to Devexpress

ImageEdit.Image Property

windowsforms-devexpress-dot-xtraeditors-dot-imageedit.md

latest3.0 KB
Original Source

ImageEdit.Image Property

Sets or gets the image displayed by the editor.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Appearance")]
public virtual Image Image { get; set; }
vb
<DXCategory("Appearance")>
<DefaultValue(Nothing)>
Public Overridable Property Image As Image

Property Value

TypeDefaultDescription
Imagenull

A Image object representing the image displayed by the editor.

|

Remarks

The Image property value is equivelant to the ImageEdit.EditValue property value. The property is declared to avoid type conversion when accessing the image displayed by the editor.

The following example assigns an image to the control.

csharp
imageEdit1.Image = Image.FromFile("workspace.png");
vb
ImageEdit1.Image = Image.FromFile("workspace.png")

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-custom-imageedit-with-preview/CS/WindowsApplication3/Main.cs#L19

csharp
customEdit1.Image = SystemIcons.Shield.ToBitmap();
}

winforms-custom-imageedit-with-preview/VB/WindowsApplication3/Main.vb#L18

vb
gridControl1.DataSource = GetData()
    customEdit1.Image = SystemIcons.Shield.ToBitmap()
End Sub

See Also

SizeMode

EditValue

ImageEdit Class

ImageEdit Members

DevExpress.XtraEditors Namespace