最近在做一个功能,点密码框右边的小眼睛显示密码,

可是要显示密码就需要改变TextBox.PassWordChar的值,

这样的话就必须知道char类型的初始值是什么了,经过查找发现,char类型的初始值是'\0',

于是方案就出来了

private void picb_ShowPWD_MouseDown(object sender, MouseEventArgs e)
{
        txt_Password.PasswordChar = '\0';
}

private void picb_ShowPWD_MouseUp(object sender, MouseEventArgs e)
{
        txt_Password.PasswordChar = '*';
}

 

 

相关文章:

  • 2021-12-03
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-09-08
  • 2021-11-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案