单击复选框时显示和隐藏密码 [英] Show and Hide password on a checkbox click

查看:99
本文介绍了单击复选框时显示和隐藏密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



Hi all

<PasswordBox Canvas.Left="305" Canvas.Top="333" Height="23" name="txtAdminPass" Width="78"/>
<PasswordBox Canvas.Left="515" Canvas.Top="331" Height="23" Name="txtAdminConfirmPass" Width="84"/>





这是我的两个密码bo xes ..密码字符是*。

现在我在它们旁边放了一个复选框。



现在我想要当我检查时复选框应该显示原始密码,取消选中它应该显示****



请告诉我该怎么做..



this are my two password boxes..the password character is *.
now i placed one checkbox next to them.

now i want like when i check the checkbox it should show the orginal password and on uncheck it should show ****

Please tell me how to do that..

推荐答案

System.Windows.Controls.PasswordBox 根本不允许显示密码字符:



请参阅: http://msdn.microsoft.com /en-us/library/system.windows.controls.passwordbox.aspx [ ^ ]。



这被认为是不安全的。



只有在创建自己的 System.Windows.Controls.TextBox 派生的密码输入类时才能实现此类效果。



-SA
The class System.Windows.Controls.PasswordBox does not allow showing password characters at all:

Please see: http://msdn.microsoft.com/en-us/library/system.windows.controls.passwordbox.aspx[^].

This is considered as unsafe.

You can achieve such effect only if you create your own password input class derived from System.Windows.Controls.TextBox.

—SA


这篇关于单击复选框时显示和隐藏密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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