c#中textbox属性
Here we are demonstrating use of PasswordChar property of TextBox.
在这里,我们演示了TextBox的PasswordChar属性的使用。
Using TextBox.PasswordChar property we can set any special character for display in the TextBox, It is basically used for password input in Windows application development.
使用TextBox.PasswordChar属性,我们可以设置要在TextBox中显示的任何特殊字符,它基本上用于Windows应用程序开发中的密码输入。
Example:
例:

In this example, we took a Windows form that contains a TextBox named txtInput, Here, we are setting PasswordChar property to asterisk sign (*) to input password character. In the above image – we actually input "ABCD", but instead of "ABCD" it displayed "****".
在此示例中,我们采用了一个Windows窗体,其中包含一个名为txtInput的文本框 ,在这里,我们将PasswordChar属性设置为星号(*),以输入密码字符。 在上图中–我们实际上输入了“ ABCD” ,但显示的是“ ****”而不是“ ABCD ” 。

Change the property using code:
使用代码更改属性:
private void Form1_Load(object sender, EventArgs e)
{
textInput.PasswordChar = '*';
}
翻译自: https://www.includehelp.com/dot-net/textbox-passwordchar-property-with-example.aspx
c#中textbox属性