I have created two buttons where the .Text property contains characters that I want to center, but I can't get it to work properly. Currently the buttons look like this:
And the code looks like this:
btnUp.Text = "▲";
btnDown.Text = "▼";
btnUp.TextAlign = ContentAlignment.MiddleCenter;
btnDown.TextAlign = ContentAlignment.MiddleCenter;
But what I really want is the Buttons' texts to be centered, so the arrows will be exactly in the middle of the controls. How would I achieve this?
A closer look to show why I am not happy:
Thanks to Thomas Mondel's solution Here is the result:
You can try to set the UseCompatibleTextRendering
property on the buttons to True
. It did the trick for me.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With