TextBox.MaxLength 属性

定义

获取或设置文本框中允许的最大字符数。 默认值为 0,这意味着长度没有限制。 此 API 已过时。 有关如何开发 ASP.NET 移动应用程序的信息,请参阅 Mobile Apps &具有 ASP.NET 的网站。

public:
 property int MaxLength { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public int MaxLength { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.MaxLength : int with get, set
Public Property MaxLength As Integer

属性值

文本框中允许的最大字符数。

属性

例外

该值小于零。

适用于

另请参阅