开发者

Change font size on button

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜