如何取消屏蔽密码文本框并将其屏蔽回密码? [英] How can I unmask password text box and mask it back to password?

查看:79
本文介绍了如何取消屏蔽密码文本框并将其屏蔽回密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将密码文本框设置为:

How can password textbox that set to :

password_txtBox.PasswordChar ="*"

要取消屏蔽(通过复选框),然后再次屏蔽

,而不会丢失文本框内的字符串

to be unmasked ( from checkbox ) and then mask again
without loosing the string inside the textbox

推荐答案

只需将属性设置为'\0'(这是默认值)即可不屏蔽字符。

Just set the property to '\0' (which is the default value) to not mask characters.

来源: http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.passwordchar.aspx

注意:请注意, \0与 0不同。第一个是空字符,白色的 0是将显示为0的字符。

Note: notice that '\0' is different from '0'. The first one is the null character, white '0' is the character that will be displayed as 0.

这篇关于如何取消屏蔽密码文本框并将其屏蔽回密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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