我想在文本框中隐藏密码。密码是硬编码的,我知道这不是很好,但它是项目所需的全部。
目前我正在使用点击事件,但是当使用选项卡时没有实现代码。
如何才能做到这一点?这是我当前的代码:
// Password Text Box Click Event
private void txtPassword_Click(object sender, EventArgs e)
{
// When password text box clixked, the watermark will disappear
txtPassword.Text = "";
txtPassword.ForeColor = Color.Black;
txtPassword.PasswordChar = '?'; // Password masking for added security
}
Run Code Online (Sandbox Code Playgroud)