WPF on the form has a button when the button res开发者_运维百科izes the form changes the size. How would I change the font size on buttons when resizing the buttons?
Put the text in a TextBlock inside a ViewBox.
<Button>
<Viewbox>
<TextBlock>Text</TextBlock>
</Viewbox>
</Button>
Then add some margins to the ViewBox. You can adjust the Stretch and StretchDirection as required (i.e. do you want to text to be vertically stretched, or do you want the proportions to stay the same?). The default stretch is Uniform which is probably what you want.
精彩评论