5

As suggested I allow all of my WPF UIElements to have a dynamic size so they can be resized easily however, in TextBlocks I have to specify the size of the Font. This means when the element's size increases or decreases the Font size stays the same. Is there a way for the Font size to be dynamic?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
James
  • 3,597
  • 11
  • 47
  • 57

1 Answers1

15

Try putting the text inside the control into a Viewbox:

<Button>
    <Viewbox>
        <TextBlock>Text To Resize</TextBlock>
    </Viewbox>
</Button>
Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Simon
  • 33,714
  • 21
  • 133
  • 202