C# - 是否有一个文本框字符的限制? [英] c# - Is there a character limit on textboxes?

查看:127
本文介绍了C# - 是否有一个文本框字符的限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
最大字符文本框在C#?

是否有已知在与MaxLenght C#的winform应用程序的文本框的字符限制设置为0?

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

谢谢,
汉斯

推荐答案

Win32文档说:

在EM_SETLIMITTEXT被调用时,文本的用户可以输入金额的缺省限制在编辑控件32,767个字符。

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.

有关单行编辑控件,文本限制为[...] 0x7FFFFFFE(2147483646)字节

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

TextBoxBase.MaxLength 资料证实了这一点:

这可以输入到控件的字符数。默认值是32767。

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

如果MaxLength属性设置为0,用户可以输入字符的最大数量为[在Windows ME或32,766]或2147483646根据可用内存中较小的金额。

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.

这篇关于C# - 是否有一个文本框字符的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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