我使用下面的链接,为粗给出的简单Dialog
箱(这就是我所需要的)密码输入框:把“*”值对话框中的C#形成
http://www.csharp-examples.net/inputbox-class/
怎么办我将文字设置为显示****
而不是密码?
我使用下面的链接,为粗给出的简单Dialog
箱(这就是我所需要的)密码输入框:把“*”值对话框中的C#形成
http://www.csharp-examples.net/inputbox-class/
怎么办我将文字设置为显示****
而不是密码?
在该控件中您有一个文本框,将该文本框的PasswordChar
属性设置为*
。
另请参见:如何:Create a Password Text Box with the Windows Forms TextBox Control
在控件的显示方法,定义一个文本框后,添加:
textBox.PasswordChar = '*';
'+ 1'是西部最快的枪支。 –
使用这样
textBox1.PasswordChar = '*';
从How to: Create a Password Text Box with the Windows Forms TextBox Control
要创建密码文本框
- 的
TextBox
控制的PasswordChar
属性设置为特定字符。PasswordChar
属性指定文本框中显示的字符 。例如,如果要星号显示在 密码框中,请在Properties
窗口中为PasswordChar
属性指定*
。然后,无论用户在 文本框中键入什么字符,都会显示一个星号。
// The password character is an asterisk.
textBox1.PasswordChar = '*';
获取或设置用于在 单行TextBox控件以掩蔽密码的字符的字符。
textBox1.PasswordChar = '*';
只设置文本框属性,它应该工作。
从Windows中的属性窗口形成
Web App或winform应用程序? –