Alignment & size of Wingdings character on Winforms button

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Alignment & size of Wingdings character on Winforms button

Post by ic2 »

These 2 equally sized pushbuttons both have a Wingdings character as Text on a Winforms form.

The right button is Wingdings 20 pt with TextAlign MiddleCenter. This looks good to me. BTW, it fits a bit better on 18 pt and then it still centers.

The left button is Wingdings 26 pt with TextAlignTopCenter. It does not look good, because it doesn't use nearly half of the upper part of the button. Changing from MiddleCenter to TopCenter doesn't even make any difference. Changing it (also) to Wingdings 20 pt does center the picture but it then looks considerably smaller than the character on the right button with the same point size. Enlarging it (as I did in the picture, to 26 pt) pushes it down on the button with no (obvious) way to center it, which should make it more visible.

Did anybody experience the same, and is there some explanation (or better: solution) for this?
2WingDings.jpg
2WingDings.jpg (2.99 KiB) Viewed 655 times
Dick
TerryB1
Posts: 306
Joined: Wed Jan 03, 2018 11:58 am

Alignment & size of Wingdings character on Winforms button

Post by TerryB1 »

Dick

I am not in a position to try this at the moment, but what you are seeing seems to be consistent with what I would expect.

The image in the offending Wingding has already been positioned. You need a different Wingding.

The image in the other Wingding (What is it a letterbox?) has already been positioned centrally.

I did take a quick look at Wingdings but couldn't find anything suitable. Some hands perhaps and convert to png's or jpegs? Not tried this on buttons, but maybe it's worth a go.

Terry
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Alignment & size of Wingdings character on Winforms button

Post by ic2 »

Hello Terry,

Thanks for your reply on this pretty odd subject!

I am not sure if it is 'as to be expected' that the lay-out / positioning of different Wingding characters differs.
But you are of course correct that I basically should add pictures. It's probably just laziness :P that I wanted to just use Wingdings.

Dick
TerryB1
Posts: 306
Joined: Wed Jan 03, 2018 11:58 am

Alignment & size of Wingdings character on Winforms button

Post by TerryB1 »

Hi Dick

Just a thought: Try changing the Background colour of your TextBlock, it may help to show what is happening.

Terry
Post Reply