Is there a reason why the text content of a WPF button is appearing with unwanted space above the text?
I have a button in a StackPanel. This button is a simple close b
My guess is that you see this problem because there's a conflict between the height you gave it and the space it actually needs to render itself properly.
Things you can do to solve this:
Also, as mentioned by Heinzi in the comments you should of course use an uppercase X.
By the way, here's a trick you can use if you want to make the button be a proper square while making sure the button gets the size it needs.
This effectively lets the button decide what height it needs and then you set the Width to that calculated value.