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

后端 未结 6 1336
借酒劲吻你
借酒劲吻你 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 11:01

    I was also wondering how to store it cleanly in a variable. As using

    char c = '•';
    

    is not very good practice (I guess). I found out the following way of storing it in a variable

    char c = (char)0x2022;// or 0x25cf depending on the one you choose
    

    or even cleaner

    char c = '\u2022';// or "\u25cf"
    

    https://msdn.microsoft.com/en-us/library/aa664669%28v=vs.71%29.aspx

    same for strings

    string s = "\u2022";
    

    https://msdn.microsoft.com/en-us/library/362314fe.aspx

提交回复
热议问题