Spook
Spook

Reputation: 25927

Imagebeforetext does not center button contents

I'm using Windows Forms.NET.

I've configured a button in the following way:

ImageAlign: MiddleCenter
TextAlign: MiddleCenter
TextImageRelation: ImageBeforeText

The problem is, when I make button wider than usual, its contents are no longer centered:

Invalid button content rendering

Why is it so? How can I correct it?

Upvotes: 0

Views: 246

Answers (1)

King King
King King

Reputation: 63317

I think the Text and Image share 2 even parts of the Button Client area horizontally. So if you set the TextImageRelation as OverLay, ImageAboveText, TextAboveImage they should be what we expect. But for other values, they act differently. I think that's by design.

To solve your problem, I have tried changing ImageAlign to MiddleRight and it works as what you want.

Again, I think that's by design. :)

Upvotes: 3

Related Questions