语言

TextBox.MaxLength 属性

定义

获取或设置指定用户输入允许的最大字符数的值。

public:
 property int MaxLength { int get(); void set(int value); };
int MaxLength();

void MaxLength(int value);
public int MaxLength { get; set; }
var int32 = textBox.maxLength;
textBox.maxLength = int32;
Public Property MaxLength As Integer
<TextBox MaxLength="int"/>

属性值

Int32

int

用户输入允许的最大字符数。 默认值为 0(无限制)。

注解

MaxLength 值 0 指定用户输入允许的字符数没有限制。

适用于