2013-05-21 20 views

回答

1

使用这样

textBox1.PasswordChar = '*'; 
0

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.PasswordChar属性

获取或设置用于在 单行TextBox控件以掩蔽密码的字符的字符。

0
textBox1.PasswordChar = '*'; 

只设置文本框属性,它应该工作。

0

从Windows中的属性窗口形成

enter image description here