如何让 WPF TextBox 使用密码字符? [英] How to make a WPF TextBox use password characters?

查看:99
本文介绍了如何让 WPF TextBox 使用密码字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动态设置它..

我可以将密码框设为普通文本吗?我的意思是 - 用户可以看到他输入的文字.???

Can i make password Box to as normal text- i mean- user could see the text what he entered.???

它的用途->我需要对密码会话"和项目计数输入"会话使用相同的控件..??

its for-> i need to use same control for " password sesion" and also the "item count entering" session ..??

推荐答案

你必须使用 PasswordBox 而不是 TextBox:

You have to use PasswordBox instead of TextBox:

<PasswordBox Height="42" Width="200"  Margin="22,28,28,0" 
         Name="passwordBox1" VerticalAlignment="Top" 
         Background="LightBlue" Foreground="DarkBlue" 
         MaxLength="25" PasswordChar="*" 
         />

这篇关于如何让 WPF TextBox 使用密码字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆