Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以执行以下操作:
如果选中“RadioButton1”,则让它在“Textbox2.text”中显示带有密码字符的文本。
这可能吗?
使用UseSystemPasswordChar属性:
UseSystemPasswordChar
Textbox2.UseSystemPasswordChar = (RadioButton1.Checked);
if (RadioButton1.Checked) { textBox2.PasswordChar = '*'; } else { textBox2.PasswordChar = '*'; }
您可以将此代码放在 RadioButton CheckedChanged 事件中...