Back to Devexpress

SimpleButton.ImageLocation Property

windowsforms-devexpress-dot-xtraeditors-dot-simplebutton-9999bba3.md

latest3.1 KB
Original Source

SimpleButton.ImageLocation Property

Specifies the image alignment relative to the button.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[DefaultValue(ImageLocation.Default)]
[DXCategory("Appearance")]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual ImageLocation ImageLocation { get; set; }
vb
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<DXCategory("Appearance")>
<DefaultValue(ImageLocation.Default)>
Public Overridable Property ImageLocation As ImageLocation

Property Value

TypeDefaultDescription
ImageLocationDefault

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

|

Available values:

NameDescription
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

Use the SimpleButton.ImageOptions property to display an image in a button and specify image-related settings.

csharp
simpleButton1.Text = "";
simpleButton1.ImageOptions.Image = Image.FromFile(".\\Stars3_1.png");
simpleButton1.ImageOptions.Location = ImageLocation.MiddleCenter;
vb
simpleButton1.Text = ""
simpleButton1.ImageOptions.Image = Image.FromFile(".\Stars3_1.png")
simpleButton1.ImageOptions.Location = ImageLocation.MiddleCenter

See Also

ImageOptions

SimpleButton Class

SimpleButton Members

DevExpress.XtraEditors Namespace