-->
In that form i'm using a PasswordBox to get the SQL Server user password. Since this data is saved to disk for future use (in a pasword protected SQL Server CE database file), while on first run there is no password set, if the user comes back and needs to edit the SQL connection for some reason, then there could be a password kept from the. Jun 23, 2014 This page serves as a repository of default passwords for various devices and applications. Hardware devices listed below include network devices such as routers, modems, and firewalls, along with various storage devices and computer systems. This is a substantial list, but it is not regularly updated.
A password box is a text input box that conceals the characters typed into it for the purpose of privacy. A password box looks like a text box, except that it renders placeholder characters in place of the text that has been entered. You can configure the placeholder character.
By default, the password box provides a way for the user to view their password by holding down a reveal button. You can disable the reveal button, or provide an alternate mechanism to reveal the password, such as a check box.
Get the Windows UI Library
Windows UI Library 2.2 or later includes a new template for this control that uses rounded corners. For more info, see Corner radius. WinUI is a NuGet package that contains new controls and UI features for Windows apps. For more info, including installation instructions, see Windows UI Library.
The password box has several states, including these notable ones. A password box at rest can show hint text so that the user knows its purpose: When the user types in a password box, the default behavior is to show bullets that hide the text being entered: Pressing the 'reveal' button on the right gives a peek at the password text being entered. In the Change Account dialog box, click More Settings. In the Microsoft Exchange dialog box, select the Security tab. On the Logon network security list, select Anonymous Authentication, and then click OK. Click Next, click Finish, and then click Close on the Account Settings dialog box. Has designed the software Business in a Box allowing the user to create administrative letters. It can be used in every form of business, whether it is a start-up, a small business or a large corporation.
Platform APIs: PasswordBox class, Password property, PasswordChar property, PasswordRevealMode property, PasswordChanged event
Is this the right control?
Use a PasswordBox control to collect a password or other private data, such as a Social Security number.
For more info about choosing the right text control, see the Text controls article.
Examples
XAML Controls Gallery |
---|
If you have the XAML Controls Gallery app installed, click here to open the app and see the PasswordBox in action. |
The password box has several states, including these notable ones.
A password box at rest can show hint text so that the user knows its purpose:
When the user types in a password box, the default behavior is to show bullets that hide the text being entered:
Pressing the 'reveal' button on the right gives a peek at the password text being entered:
Create a password box
Use the Password property to get or set the contents of the PasswordBox. You can do this in the handler for the PasswordChanged event to perform validation while the user enters the password. Or, you can use another event, like a button Click, to perform validation after the user completes the text entry.
Here's the XAML for a password box control that demonstrates the default look of the PasswordBox. When the user enters a password, you check to see if it's the literal value, 'Password'. If it is, you display a message to the user.
Here's the result when this code runs and the user enters 'Password'.
Password character
You can change the character used to mask the password by setting the PasswordChar property. Here, the default bullet is replaced with an asterisk.
The result looks like this.
Headers and placeholder text
You can use the Header and PlaceholderText properties to provide context for the PasswordBox. This is especially useful when you have multiple boxes, such as on a form to change a password.
Maximum length
Specify the maximum number of characters that the user can enter by setting the MaxLength property. There is no property to specify a minimum length, but you can check the password length, and perform any other validation, in your app code.
Password reveal mode
The PasswordBox has a built-in button that the user can press to display the password text. Here's the result of the user's action. When the user releases it, the password is automatically hidden again.
Peek mode
By default, the password reveal button (or 'peek' button) is shown. The user must continuously press the button to view the password, so that a high level of security is maintained.
The value of the PasswordRevealMode property is not the only factor that determines whether a password reveal button is visible to the user. Other factors include whether the control is displayed above a minimum width, whether the PasswordBox has focus, and whether the text entry field contains at least one character. The password reveal button is shown only when the PasswordBox receives focus for the first time and a character is entered. If the PasswordBox loses focus and then regains focus, the reveal button is not shown again unless the password is cleared and character entry starts over.
Caution Prior to Windows 10, the password reveal button was not shown by default. If the security of your app requires that the password is always obscured, be sure to set PasswordRevealMode to Hidden.
Hidden and Visible modes
The other PasswordRevealMode enumeration values, Hidden and Visible, hide the password reveal button and let you programmatically manage whether the password is obscured.
To always obscure the password, set PasswordRevealMode to Hidden. Unless you need the password to be always obscured, you can provide a custom UI to let the user toggle the PasswordRevealMode between Hidden and Visible. For example, you can use a check box to toggle whether the password is obscured, as shown in the following example. You can also use other controls, like ToggleButton, to let the user switch modes.
This example shows how to use a CheckBox to let a user switch the reveal mode of a PasswordBox.
This PasswordBox looks like this.
Choose the right keyboard for your text control
Etisalat Business In A Box Default Password
To help users to enter data using the touch keyboard, or Soft Input Panel (SIP), you can set the input scope of the text control to match the kind of data the user is expected to enter. PasswordBox supports only the Password and NumericPin input scope values. Any other value is ignored.
For more info about how to use input scopes, see Use input scope to change the touch keyboard.
Recommendations
- Use a label or placeholder text if the purpose of the password box isn't clear. A label is visible whether or not the text input box has a value. Placeholder text is displayed inside the text input box and disappears once a value has been entered.
- Give the password box an appropriate width for the range of values that can be entered. Word length varies between languages, so take localization into account if you want your app to be world-ready.
- Don't put another control right next to a password input box. The password box has a password reveal button for users to verify the passwords they have typed, and having another control right next to it might make users accidentally reveal their passwords when they try to interact with the other control. To prevent this from happening, put some spacing between the password in put box and the other control, or put the other control on the next line.
- Consider presenting two password boxes for account creation: one for the new password, and a second to confirm the new password.
- Only show a single password box for logins.
- When a password box is used to enter a PIN, consider providing an instant response as soon as the last number is entered instead of using a confirmation button.
Get the sample code
- XAML Controls Gallery sample - See all the XAML controls in an interactive format.