How do you have Silverlight resize text content to fit? How do you have Silverlight resize text content to fit? wpf wpf

How do you have Silverlight resize text content to fit?


A similar question was asked yesterday about resizing content automatically relative to the size of a container. The answer in this case is the same: use a Viewbox. If you put your TextBlock inside of the Viewbox, the TextBlock will resize itself to only use the space it needs, and the Viewbox will handle stretching this to the dimensions of the container. Use the stretch attribute to choose from one of four stretching methods.

Take a look at this thread from yesterday:

WPF Gui that changes size with window?


Try a Dockpanel instead of a Grid. Using LastChildFill=true should get you the behavior that you're looking for.


Have you looked into transform ScaleTransform?

ib.