PasswordBox.IsPasswordRevealButtonEnabled 属性

定义

获取或设置一个值,该值指定 PasswordBox 的可视 UI 是否包含切换显示或隐藏键入字符的按钮元素。 在 Windows 10 及更高版本中,请改用 PasswordRevealMode

public:
 property bool IsPasswordRevealButtonEnabled { bool get(); void set(bool value); };
/// [get: Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [set: Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
bool IsPasswordRevealButtonEnabled();

void IsPasswordRevealButtonEnabled(bool value);
/// [get: Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
bool IsPasswordRevealButtonEnabled();

void IsPasswordRevealButtonEnabled(bool value);
public bool IsPasswordRevealButtonEnabled { [Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; [Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] set; }
public bool IsPasswordRevealButtonEnabled { [Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; [Windows.Foundation.Metadata.Deprecated("IsPasswordRevealButtonEnabledProperty may be altered or unavailable for releases after Windows 10.0. Instead, use PasswordRevealModeProperty.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] set; }
var boolean = passwordBox.isPasswordRevealButtonEnabled;
passwordBox.isPasswordRevealButtonEnabled = boolean;
Public Property IsPasswordRevealButtonEnabled As Boolean
<PasswordBox IsPasswordRevealButtonEnabled="bool" />

属性值

Boolean

bool

如果为 True ,则显示密码显示按钮; 如果为 false ,则不显示密码显示按钮。 默认值为 false

属性

注解

Windows 10PasswordRevealMode 取代了 IsPasswordRevealButtonEnabled,为你提供更多用户如何查看其密码的选项。 将忽略 IsPasswordRevealButtonEnabled 属性。

此属性的值不是确定密码显示按钮是否对用户可见的唯一因素。 其他因素包括控件是否显示在最小宽度上方、 PasswordBox 是否具有焦点以及文本输入字段是否至少包含一个字符。

适用于