Which passwordchar shows a black dot • in a winforms textbox?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
In a WinForms TextBox, the black-dot character people usually want is the Unicode bullet •, which is \u2022. You can assign that character to PasswordChar, but there is one important caveat: the final appearance still depends on the control's font and the operating system's text rendering.
Set PasswordChar to the Bullet Character
The direct answer is:
You can also write the literal directly if the source file encoding supports it:
That tells the TextBox to display the bullet glyph for each entered character instead of the real text.
PasswordChar Versus UseSystemPasswordChar
There are two related ways to mask text in WinForms:
- '
PasswordChar' - '
UseSystemPasswordChar'
Example:
UseSystemPasswordChar lets Windows choose the masking glyph according to system behavior. If the goal is "make it look native on this machine," that is often better than forcing one exact character. If the goal is specifically "show a bullet," set PasswordChar yourself.
The two properties should not be treated as unrelated. In practical UI code, you usually choose one strategy:
- explicit bullet with
PasswordChar - native OS masking with
UseSystemPasswordChar
The Font Still Matters
A common surprise is that \u2022 does not always look the same. The control will render whatever glyph the active font provides for that code point. On one font it may appear as a solid dot. On another it may look smaller, higher, lighter, or slightly different from the system password mask.
That is why developers sometimes think they chose the wrong character when the real issue is font selection. If exact appearance matters, test the TextBox with the same font your form uses in production.
Minimal Working Example
This is enough to render a password field with a bullet mask in a standard WinForms app.
Security Reminder
Masking the display does not secure the password by itself. PasswordChar only changes what the user sees on screen. It does not encrypt the value, protect it in memory, or prevent insecure logging elsewhere in the application.
That matters because UI masking is often confused with password handling. They solve different problems:
- masking helps prevent shoulder surfing
- secure storage and transmission protect the actual secret
It is also worth thinking about accessibility and consistency. If the application needs to look native on different Windows themes and fonts, UseSystemPasswordChar may provide a better user experience than forcing one exact glyph.
Common Pitfalls
- Using the wrong Unicode character when the intended bullet is
\u2022. - Forgetting that the rendered glyph depends on the
TextBoxfont. - Expecting
PasswordCharto look identical to the native system password mask on every machine. - Setting both
PasswordCharandUseSystemPasswordCharwithout deciding which behavior should win. - Assuming a masked
TextBoxmakes password handling secure by itself.
Summary
- The usual black-dot password character is the Unicode bullet
\u2022. - Set it with
textBox.PasswordChar = '\u2022';. - Use
UseSystemPasswordCharinstead if you want the operating system's native mask. - Test the chosen glyph with the actual font used by the control.
- Remember that display masking is a UI feature, not a full security solution.

