PasswordBox.InputScope Property


Gets or sets the context for input used by this PasswordBox.

Equivalent WinUI property: Microsoft.UI.Xaml.Controls.PasswordBox.InputScope.

 property InputScope ^ InputScope { InputScope ^ get(); void set(InputScope ^ value); };
InputScope InputScope();

void InputScope(InputScope value);
public InputScope InputScope { get; set; }
var inputScope = passwordBox.inputScope;
passwordBox.inputScope = inputScope;
Public Property InputScope As InputScope
        <InputScopeName NameValue="inputScopeName"/>

Property Value


The input scope, which provides a hint at the type of text input expected by the control. The default is null.


Here's how to set the InputScope in XAML and in code.

<PasswordBox x:Name="pinBox" Header="Enter PIN">
                <InputScopeName NameValue="NumericPin"/>
PasswordBox passwordBox = new PasswordBox();
passwordBox.Header = "Enter password";

InputScope scope = new InputScope();
InputScopeName scopeName = new InputScopeName();
scopeName.NameValue = InputScopeNameValue.Password;
passwordBox.InputScope = scope;


The InputScope property on PasswordBox supports only the Password and NumericPin values. Any other value is ignored.

The input scope provides a hint at the type of text input expected by the control. Various elements of the system can respond to the hint provided by the input scope and provide a specialized UI for the input type. For example, the soft keyboard might show a number pad for text input when the control has its InputScope set to NumericPin.

The input scope does not perform any validation, and does not prevent the user from providing any input through a hardware keyboard or other input device.

Applies to

See also