我在 UWP 应用中使用密码框控件。默认情况下,它会显示一个眼睛图标,用户可以通过该图标看到密码以了解他输入的密码是否正确。
这是我当前的代码:
<Page
x:Class="UwpApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UwpApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<PasswordBox HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid>
</Page>
虽然我的应用程序面向 Windows 10,但我想根据我的应用程序要求删除此显示功能的密码
有趣的是,passwordbox control available for WPF applications 中没有显示此功能的密码。 ?
最佳答案
您可以在PasswordBox
中添加PasswordRevealMode="Hidden"
关于c# - 如何从 UWP 应用中的密码框中删除密码帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49749380/