語言

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 表示使用者輸入字元數沒有限制。

適用於