动态增加.net中的文本框宽度 [英] Dynamically increase Textbox width in .net
本文介绍了动态增加.net中的文本框宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文本框,我希望随着用户继续在文本框中输入数据而增加宽度.....
I have a textbox and i want his width to be increased as user goes on entering data into textbox.....
推荐答案
int size = 5;
int finalWidth = size* txtBox.Text.Length;
txtBox.Width = new Unit(finalWidth);
You'll need to change size to be how big you want to allow per letter.
^ ]是您的朋友.这样做已经进行了很多次,以至于互联网上充满了例子.
如果要使用jQuery,请此 [
Google [^]is your friend. This has been done so many times that internet is full of examples.
If you want to use jQuery, this [^]one is a good example.
@Manas
在这种情况下,它们的高度正在增加,我想增加文本框的宽度,我搜索了google thats,这是每个人都要做的第一件事,但是我没有任何解决方案,那是我在本网站中问到的.
@Manas
in this they are increasing height i want to increase width of the textbox and i searched of google thats first thing everyone will do but i didnt got any solution working for me thats i asked in this site.
这篇关于动态增加.net中的文本框宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文