Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如建议的那样,我允许我所有的 WPFUIElement具有动态大小,因此可以轻松调整它们的大小,但是,在TextBlocks 中,我必须指定Font. 这意味着当元素的大小增加或减小时,字体大小保持不变。有没有办法让Font尺寸变成动态的?
UIElement
TextBlock
Font
尝试将控件内的文本放入Viewbox:
Viewbox
<Button> <Viewbox> <TextBlock>Text To Resize</TextBlock> </Viewbox> </Button>