WPF/Silverlight XAML Stretch Text Size to Fit container?

后端 未结 4 1103
灰色年华
灰色年华 2020-12-30 22:42

I\'ve just started to play with WPF.

Is it possible to have the size of the text of a Label or TextBlock size itself to fill it\'s parent container?

Thanks,

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 23:34

    You can use a ViewBox to visually zoom something to fit within its container. The other solutions here work, but they only stretch the control, not its content. The ViewBox will stretch both.

    
    
     
     
    
    

提交回复
热议问题