Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Short question here:

In .Net 4.0 Winforms, how do I use the PasswordChar property of a Textbox to show a common black dot as a character? Is there perhaps some font I can use that has this as a character?

If I use 'UseSystemPasswordChar = true' it shows an asterisk (*).

like image 778
Edwin de Koning Avatar asked Oct 29 '10 11:10

Edwin de Koning


4 Answers

You can use this one:

You can type it by holding Alt and typing 25CF.


Alternately, you may use this smaller one:

You can type it by holding Alt and typing 2022.

like image 179
Giorgi Avatar answered Nov 18 '22 11:11

Giorgi


Use the Unicode Character 'BLACK CIRCLE' (U+25CF) http://www.fileformat.info/info/unicode/char/25CF/index.htm

To copy and paste: ●

like image 40
Mark Menchavez Avatar answered Nov 18 '22 10:11

Mark Menchavez


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

like image 20
Wasabi Avatar answered Nov 18 '22 10:11

Wasabi


One more solution to use this Unicode black circle >>

Start >> All Programs >> Accessories >> System Tools >> Character Map

Then select Arial font and choose the Black circle copy it and paste it into PasswordChar property of the textbox.

That's it....

like image 10
dotnetmaster Avatar answered Nov 18 '22 09:11

dotnetmaster