如何将文本框中条目的长度限制为其宽度 [英] how to restrict the length of entries in text box to its width
本文介绍了如何将文本框中条目的长度限制为其宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
c#:默认情况下,文本框接受 n 个条目,
c#: By default text box accepts n number of entries,
我想限制条目的宽度
文本框中是否有任何属性可以实现此目的,
Is there any property in text box through which i can achive this,
推荐答案
您可以计算要绘制的文本的宽度,如果超过文本框的宽度,则返回.
You could compute the width of the text to be drawn and if it exceeds the textbox width then return.
这里很好的例子.
这篇关于如何将文本框中条目的长度限制为其宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文