如何在WPF中使用文本框作为密码框
问题描述:
嗨朋友
我想在WPF中使用文本框作为密码框.我们分别有密码框,但我需要在同一文本框中自己输入密码.想要在文本框本身中将字符更改为ex(*),请帮助我.
hi friends
i want to use textbox as password box in wpf. we have password box seperately but i need it in same textbox iteself. want to change the character as ex(*) in textbox itself please help me out.
答
正确的解决方案是:
The right solution is:
<passwordbox x:name="txtPassword" xmlns:x="#unknown">
ToolTip="Password"
PasswordChar="*"
/></passwordbox>
http://social.msdn.microsoft.com/Forums/en/wpf/thread/69e82b78-08c5-4b37-85db-d270b1005ad5 [
http://social.msdn.microsoft.com/Forums/en/wpf/thread/69e82b78-08c5-4b37-85db-d270b1005ad5[^]
Try this
选择文本框,右键单击,选择属性;在属性窗口中;在文本模式"选项中
选择密码.
select text box,right click,select property ;in property window;in "text mode" option
select password.