Which passwordchar shows a black dot (•) in a winforms textbox?

后端 未结 6 1473
借酒劲吻你
借酒劲吻你 2020-12-24 10:19

Short question here:

In .Net 4.0 Winforms, how do I use the PasswordChar property of a Textbox to show a common bl

6条回答
  •  死守一世寂寞
    2020-12-24 10:44

    Below are some different ways to achieve this. Pick the one suits you

    1. In fonts like 'Tahoma' and 'Times new Roman' this common password character '●' which is called 'Black circle' has a unicode value 0x25CF. Set the PasswordChar property with either the value 0x25CF or copy paste the actual character itself.

    2. If you want to display the Black Circle by default then enable visual styles which should replace the default password character from '*' to '●' by default irrespective of the font.

    3. Another alternative is to use 'Wingdings 2' font on the TextBox and set the password character to 0x97. This should work even if the application is not unicoded. Refer to charMap.exe to get better idea on different fonts and characters supported.

提交回复
热议问题