开发者

How to control the size of a TextBlock so the contents are fully displayed

开发者 https://www.devze.com 2023-03-25 02:37 出处:网络
in WPF is there a way to setup a TextBlock so its MinHeiht and MinWidth are automatically set so its content is completely visible or should I code this by myself?

in WPF is there a way to setup a TextBlock so its MinHeiht and MinWidth are automatically set so its content is completely visible or should I code this by myself?

Thanks.

EDIT: The TextBlock lives inside a grid row, I would like to setup 开发者_如何学运维the Min sizes of the row to allow the TextBlock to show its entire content.


If you set the columndefinition width for the textblock's column to 'Auto', it will grow automatically to accommodate the growing textblock.

0

精彩评论

暂无评论...
验证码 换一张
取 消