Vixen
dd8b0a81
csharp
public sealed class SecureTextBox

A field whose characters are not shown.

Read the guide page for this →

Remarks

Any login screen needs one and this control set had nothing to offer. An application asked for a password with a TextBox, in front of whoever was standing behind the user.

⚠ What makes it secure here is smaller than it would be on the web, and the reason is an absence: there is no clipboard in Vixen.Ui at all. Nothing copies, nothing cuts and nothing pastes, so the selection a field allows cannot carry anything out of it — which is why SelectedText is left alone here rather than blanked. When a clipboard arrives, this is the type it has to ask before it reads.

Masked at the last moment and nowhere else. The value is the real string — a form has to be able to submit it — and the bullets exist only in the text part and in what the accessibility tree is told, which is what a platform's own secure field reports too. The pre-edit is masked with it: an input method's intermediate reading of a password is the password.

⚠ There is no "reveal" button and its absence is a decision. Showing the value is one assignment away for an application that wants it — swap the field, or read Value into a TextBox — and a reveal built in here would be a control that can be made to display a secret by anything that can reach a property on it.

Fields and properties (3)

  • public const char Bullet

    What each character is drawn as.

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override string? NativeAccessibleValue

Methods (1)

  • protected override string? Shown(string? value)

    What the field draws for a value on its way out.

Used by (2)

  • GalleryHelloUi
  • SecureTextBoxTestsVixen.Ui.Controls.Tests