rhughes
rhughes

Reputation: 9583

WinForms button with image and text

I have a standard button on my WinForm with some text and an image. It looks like this:

Button

How can I set the button so that the image is aligned just to the left of the text? I have tried ImageAlign, but that doesn't seem to take into account the button's text.

Upvotes: 27

Views: 29772

Answers (2)

Vishal Suthar
Vishal Suthar

Reputation: 17194

For that you can use TextImageRelation Property to set it to ImageBeforeText:

Specifies that the image is displayed horizontally before the text of a control.

enter image description here

Upvotes: 15

rhughes
rhughes

Reputation: 9583

Just found it.

You need to set:

ImageAlign to MiddleRight

TextImageRelation to ImageBeforeText

TextAlign as MiddleCenter

Upvotes: 42

Related Questions