You have to include a declaration of the Class
SecureTextBox
in your source code.
SecureTextBox
is not a standard part of the Microsoft .NET Framework.
Here is one implementation that I found using Google search:
DonaqLLC/dnq.securetextboxcontrol[
^]
Then, instead of putting a
TextBox
on your Windows Form, you put a
SecureTextBox
on your Windows form.
You add a
SecureTextBox
to your Windows Form Class with C# code similar to this:
internal SecureTextBox secureTextBox1;
this.secureTextBox1 = new SecureTextBox();
this.secureTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.secureTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.secureTextBox1.Enabled = true;
this.secureTextBox1.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.secureTextBox1.Location = new System.Drawing.Point(800, 565);
this.secureTextBox1.Name = "secureTextBox1";
this.secureTextBox1.Size = new System.Drawing.Size(208, 29);
this.secureTextBox1.TabIndex = 3;
this.secureTextBox1.TabStop = true;
this.Controls.Add(this.secureTextBox1);
Note: I have not tested this myself.