如何设置为的WinForms输入查询密码的文本框? [英] How to set a text box for inputing password in winforms?
问题描述
如何设置在的WinForms输入查询密码的文本框?此外,我想显示大写锁定为开弹出如果CAPSLOCK上。
how to set a text box for inputing password in winforms? Also I want to show "Capslock is ON" popup if capslock is on.
我想是这样
<输入类型=密码/>
的HTML
推荐答案
为您解决问题的最好办法是设置 UseSystemPasswordChar
属性为true。然后,大写锁定信息显示,当用户输入的字段和大写锁定是(至少对于Vista和Windows 7)。
The best way to solve your problem is to set the UseSystemPasswordChar
property to true. Then, the Caps-lock message is shown when the user enters the field and the Caps-Lock is on (at least for Vista and Windows 7).
另一种方法是在 PasswordChar
属性设置为一个字符值(*为例)。这也触发自动大写锁定处理。
Another alternative is to set the PasswordChar
property to a character value (* for example). This also triggers the automatic Caps-Lock handling.
这篇关于如何设置为的WinForms输入查询密码的文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!