如何覆盖文本框的maxlength属性以存储更长的字符 [英] How to override textbox's maxlength Properties for longer characters to store

查看:76
本文介绍了如何覆盖文本框的maxlength属性以存储更长的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何重写文本框的maxlength属性以存储更长的字符(> 32767),例如10000000.谢谢.

How to override textbox''s maxlength Properties for longer(>32767) characters to store.such as 10000000.thank you.

推荐答案

疯了吗?

这是我什至考虑尝试将32K字符放入文本框中的唯一原因,远不及10,000,000.
您是否真的希望用户的糟糕草皮能够a)阅读或b)打字那么多?

您想通过这种想法来实现什么?
Are you certifiably insane?

It''s the only reason I can think of for even considering trying to put 32K characters into a textbox, much less 10,000,000.
Do you seriously expect the poor sod of a user to either a) read or b) type that much?

What are you trying to achieve with such an idea?


(1)最大长度永远不会影响程序可以在文本框中放入的内容,而只是影响 影响用户可以在文本框中键入的内容.因此,如果您遇到
极限,极限来自其他地方.

(2)我认为丰富的编辑框比普通的编辑框有更大的限制.
如果您的文本框是一个编辑框,请尝试一个丰富的编辑框.

(3)从MSDN(TextBoxBase :: MaxLength):如果MaxLength属性设置为0,则用户可以输入的最大字符数为2147483646或基于可用内存的数量,以较小者为准.
(1) Max Length never affects what a program can put in a text box, it only
affects what a user can type into the text box. So if you''re running into a
limit, the limit is coming from somewhere else.

(2) I think a rich edit box has a larger limit than an ordinary edit box.
If your text box is an edit box, try a rich edit box.

(3)From MSDN (TextBoxBase::MaxLength): If the MaxLength property is set to 0, the maximum number of characters the user can enter is 2147483646 or an amount based on available memory, whichever is smaller.


设置文本框属性
MaxLength="10000000"



请点击以下链接:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.maxlength.aspx [ http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.maxlength.aspx [ ^ ]



Please follow the links below:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.maxlength.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.maxlength.aspx[^]


这篇关于如何覆盖文本框的maxlength属性以存储更长的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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