可调整大小的TextBlock [英] Resizable TextBlock

查看:106
本文介绍了可调整大小的TextBlock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

有人可以帮助我创建可调整大小的TextBlock. TextBlock应该是这样的:如果文本比文本小,则不能容纳在TextBlock中,但是如果文本大于文本,则文本块的大小会增加,并且如果文本大小非常大且超过 最大文本块大小,然后减小文本字体大小以适合文本块.

Can someone help me in creating a resizable TextBlock. The TextBlock should be such that if the text is small than it should fit within the TextBlock but if the text is more than the textblock size is increased and if the text size is very large and exceeds the maximum textblock size then the text font size is decreased to fit in the textblock.

如何根据文本大小增加或减小文本块大小,以及一旦达到最大文本块大小,如何减小文本字体以适合文本块.

How can the textblock size be increased or decreased based on text size and how can the text font be decreased to fit in the textblock once it reaches the maximum textblock size.

预先感谢

推荐答案

prp_7

prp_7

在给定一些限制的情况下,我有一些代码可以执行此操作,例如,您可以设置TextBlock中允许的最大字符串长度.当前无法访问该代码,但会在今晚为您发布.

I have some code to do this exact thing given some limits, such as you set the maximum length of the string allowed in the TextBlock.  Can't currently access the code, but will post it here tonight for you.

欢呼

Paul


这篇关于可调整大小的TextBlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆