PasswordBox::MaxLength Property
.NET Framework (current version)
Gets or sets the maximum length for passwords to be handled by this PasswordBox.
Assembly: PresentationFramework (in PresentationFramework.dll)
Property Value
Type: System::Int32An integer specifying the maximum length, in characters, for passwords to be handled by this PasswordBox.
A value of zero (0) means no limit.
The default value is 0 (no length limit).
This property only restricts passwords entered manually by the user; it has no effect on programmatic manipulation of the Password property.
Identifier field | |
Metadata properties set to true | None |
The following example shows how to set the MaxLength attribute of a PasswordBox element.
<PasswordBox Name="pwdBox" MaxLength="64" PasswordChar="#" PasswordChanged="PasswordChangedHandler" />
The following example shows how to set the MaxLength property programmatically.
.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Show: