c# - Is there a character limit on textboxes? [dup

2019-03-05 07:35发布

Possible Duplicate:
Max Char in TextBox C#?

Is there a known character limit in textboxes in c# winform applications with MaxLenght set to 0 ?

Thanks, Hans

标签: c# textbox
3条回答
Rolldiameter
2楼-- · 2019-03-05 08:07

Win32 documentation says:

Before EM_SETLIMITTEXT is called, the default limit for the amount of text a user can enter in an edit control is 32,767 characters.

For single-line edit controls, the text limit is [...] 0x7FFFFFFE (2147483646) bytes

TextBoxBase.MaxLength documentation confirms this:

The number of characters that can be entered into the control. The default is 32767.

If the MaxLength property is set to 0, the maximum number of characters the user can enter is 2147483646 [or 32,766 on Windows ME,] or an amount based on available memory, whichever is smaller.

查看更多
Anthone
3楼-- · 2019-03-05 08:16
Textbox windows form control:
The number of characters that can be entered into the control.

The default is 32767. for more details : http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.maxlength.aspx

查看更多
看我几分像从前
4楼-- · 2019-03-05 08:17

for 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 :-

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.

for Windows Millennium Edition Platform :

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.

for more information see this link

查看更多
登录 后发表回答