WPF TextBlock font resize to fill available space in a Grid

后端 未结 6 1513
醉酒成梦
醉酒成梦 2020-12-08 01:53

I have some text that is displayed at run time in a textblock. I want the font size to be the biggest it can be to fill the area that is given. I think I have the textblock

6条回答
  •  一向
    一向 (楼主)
    2020-12-08 02:28

    I found a great way to do this using ViewBox:

     
        
            
            
            
            
        
        
            
            
        
        
                
        
    
        
            This is some text
        
    
    

提交回复
热议问题