0

我想知道是否可以执行以下操作:

如果选中“RadioButton1”,则让它在“Textbox2.text”中显示带有密码字符的文本。

这可能吗?

4

2 回答 2

1

使用UseSystemPasswordChar属性:

Textbox2.UseSystemPasswordChar = (RadioButton1.Checked);
于 2013-04-08T21:04:00.270 回答
0
if (RadioButton1.Checked)
{
     textBox2.PasswordChar = '*';
} else {
     textBox2.PasswordChar = '*';
}

您可以将此代码放在 RadioButton CheckedChanged 事件中...

于 2013-04-08T20:59:39.237 回答