“禁用”文本框的在C#中MaxLength属性 [英] 'Disabling' the MaxLength Property of a TextBox in C#

查看:827
本文介绍了“禁用”文本框的在C#中MaxLength属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的一个Windows窗体应用程序,我需要有一个文本框即不限制输入大小 Int32.MaxValue

I'm currently working on a Windows Forms application and I need to have a TextBox which doesn't limit input size to Int32.MaxValue.

问题是,最大长度是在<$ C的的Int32 属性$ C>文本框,我当然不能设置一个数字,它比它的值。

The problem is that MaxLength is an Int32 Property on the TextBox and I of course can't set a number which is greater than that as its value.

在理想情况下,我不不想设置任何号码都完全禁用此检查。

Ideally, I don't want to set any number at all and completely 'disable' this check.

有没有什么方法可以让我有一个文本框不限制输入的大小?

Is there any way I can have a TextBox which doesn't limit the input size?

推荐答案

它设置为零

的Windows NT 4.0,Windows 2000中,Windows 2000专业版,Windows 2000的
服务器,Windows 2000高级服务器,Windows XP家庭版,Windows
XP专业x64版,Windows Server 2003平台说明:如果
MaxLength属性设置为0,最大字符数
用户可以输入为2147483646或金额根据可用内存,
为准。小

Windows NT 4.0, Windows 2000, Windows 2000 Professional, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 Platform Note: 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.

Windows Millennium Edition的平台注:如果MaxLength属性为
设置为0,字符用户可以输入的最大数量为
。32,766或根据可用内存中较小的一个量

Windows Millennium Edition Platform Note: If the MaxLength property is set to 0, the maximum number of characters the user can enter is 32,766 or an amount based on available memory, whichever is smaller.

从: http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.maxlength.aspx



编辑Windows窗体


EDIT for windows forms

这篇关于“禁用”文本框的在C#中MaxLength属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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