PasswordBox.MaxLength 속성

정의

PasswordBox가 처리할 암호의 최대 길이를 가져오거나 설정합니다.

public:
 property int MaxLength { int get(); void set(int value); };
public int MaxLength { get; set; }
member this.MaxLength : int with get, set
Public Property MaxLength As Integer

속성 값

Int32

PasswordBox가 처리할 암호의 최대 길이(문자 수)를 지정하는 정수입니다.

값이 0 이면 제한이 없습니다.

기본값은 0 (길이 제한 없음)입니다.

예제

다음 예제에서는 설정 하는 방법을 보여 줍니다 합니다 MaxLength 특성을 PasswordBox 요소입니다.

<PasswordBox
  Name="pwdBox" 
  MaxLength="64"
  PasswordChar="#"
  PasswordChanged="PasswordChangedHandler"  
/>

다음 예제에서는 설정 하는 방법의 MaxLength 속성 프로그래밍 방식으로 합니다.

// Set the new maximum input length for passwords to 128 characters.
pwdBox.MaxLength = 128;
' Set the new maximum input length for passwords to 128 characters.
pwdBox.MaxLength = 128

설명

이 속성은 사용자가 수동으로 입력한 암호만 제한합니다. 속성의 프로그래밍 방식 조작에는 Password 영향을 주지 않습니다.

종속성 속성 정보

식별자 필드 MaxLengthProperty
메타 데이터 속성 설정 true 없음

적용 대상