UseSystemPasswordChar property cause endless loop

V

V&G

Use the following form initialization and try to change
UseSystemPasswordChar to "true".
As a result the value of PasswordChar property starts blinking in loop.
Looks like a bug...

Any comments are welcome...

===================================================================
private void InitializeComponent()
{
this.txtPort = new System.Windows.Forms.TextBox();
this.txtDatabase = new System.Windows.Forms.TextBox();
this.lblHostname = new System.Windows.Forms.Label();
this.txtHostname = new System.Windows.Forms.TextBox();
this.txtUsername = new System.Windows.Forms.TextBox();
this.panel7 = new System.Windows.Forms.Panel();
this.txtPassword = new System.Windows.Forms.TextBox();
this.panel6 = new System.Windows.Forms.Panel();
this.panel5 = new System.Windows.Forms.Panel();
this.txtDSN = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.lblPassword = new System.Windows.Forms.Label();
this.lblUsername = new System.Windows.Forms.Label();
this.lblDatabase = new System.Windows.Forms.Label();
this.lblDSN = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.lblPort = new System.Windows.Forms.Label();
this.panel7.SuspendLayout();
this.panel6.SuspendLayout();
this.panel5.SuspendLayout();
this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
this.panel3.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// txtPort
//
this.txtPort.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtPort.Location = new System.Drawing.Point(0, 2);
this.txtPort.Multiline = true;
this.txtPort.Name = "txtPort";
this.txtPort.Size = new System.Drawing.Size(182, 20);
this.txtPort.TabIndex = 34;
//
// txtDatabase
//
this.txtDatabase.Dock =
System.Windows.Forms.DockStyle.Fill;
this.txtDatabase.Location = new System.Drawing.Point(0, 2);
this.txtDatabase.Multiline = true;
this.txtDatabase.Name = "txtDatabase";
this.txtDatabase.Size = new System.Drawing.Size(182, 20);
this.txtDatabase.TabIndex = 34;
//
// lblHostname
//
this.lblHostname.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.lblHostname.Location = new System.Drawing.Point(3, 3);
this.lblHostname.Name = "lblHostname";
this.lblHostname.Size = new System.Drawing.Size(76, 16);
this.lblHostname.TabIndex = 33;
this.lblHostname.Text = "Hostname :";
//
// txtHostname
//
this.txtHostname.Dock =
System.Windows.Forms.DockStyle.Fill;
this.txtHostname.Location = new System.Drawing.Point(0, 2);
this.txtHostname.Multiline = true;
this.txtHostname.Name = "txtHostname";
this.txtHostname.Size = new System.Drawing.Size(182, 20);
this.txtHostname.TabIndex = 34;
//
// txtUsername
//
this.txtUsername.Dock =
System.Windows.Forms.DockStyle.Fill;
this.txtUsername.Location = new System.Drawing.Point(0, 2);
this.txtUsername.Multiline = true;
this.txtUsername.Name = "txtUsername";
this.txtUsername.Size = new System.Drawing.Size(182, 20);
this.txtUsername.TabIndex = 34;
//
// panel7
//
this.panel7.Controls.Add(this.txtPassword);
this.panel7.Dock = System.Windows.Forms.DockStyle.Top;
this.panel7.Location = new System.Drawing.Point(80, 125);
this.panel7.Name = "panel7";
this.panel7.Padding = new System.Windows.Forms.Padding(0,
2, 30, 3);
this.panel7.Size = new System.Drawing.Size(212, 25);
this.panel7.TabIndex = 13;
//
// txtPassword
//
this.txtPassword.Dock =
System.Windows.Forms.DockStyle.Fill;
this.txtPassword.Location = new System.Drawing.Point(0, 2);
this.txtPassword.Multiline = true;
this.txtPassword.Name = "txtPassword";
this.txtPassword.Size = new System.Drawing.Size(182, 20);
this.txtPassword.TabIndex = 34;
//
// panel6
//
this.panel6.Controls.Add(this.txtUsername);
this.panel6.Dock = System.Windows.Forms.DockStyle.Top;
this.panel6.Location = new System.Drawing.Point(80, 100);
this.panel6.Name = "panel6";
this.panel6.Padding = new System.Windows.Forms.Padding(0,
2, 30, 3);
this.panel6.Size = new System.Drawing.Size(212, 25);
this.panel6.TabIndex = 12;
//
// panel5
//
this.panel5.Controls.Add(this.txtDSN);
this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
this.panel5.Location = new System.Drawing.Point(80, 75);
this.panel5.Name = "panel5";
this.panel5.Padding = new System.Windows.Forms.Padding(0,
2, 30, 3);
this.panel5.Size = new System.Drawing.Size(212, 25);
this.panel5.TabIndex = 11;
//
// txtDSN
//
this.txtDSN.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtDSN.Location = new System.Drawing.Point(0, 2);
this.txtDSN.Multiline = true;
this.txtDSN.Name = "txtDSN";
this.txtDSN.Size = new System.Drawing.Size(182, 20);
this.txtDSN.TabIndex = 34;
//
// panel2
//
this.panel2.Controls.Add(this.txtHostname);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(80, 50);
this.panel2.Name = "panel2";
this.panel2.Padding = new System.Windows.Forms.Padding(0,
2, 30, 3);
this.panel2.Size = new System.Drawing.Size(212, 25);
this.panel2.TabIndex = 8;
//
// panel4
//
this.panel4.Controls.Add(this.txtDatabase);
this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
this.panel4.Location = new System.Drawing.Point(80, 25);
this.panel4.Name = "panel4";
this.panel4.Padding = new System.Windows.Forms.Padding(0,
2, 30, 3);
this.panel4.Size = new System.Drawing.Size(212, 25);
this.panel4.TabIndex = 10;
//
// panel3
//
this.panel3.Controls.Add(this.txtPort);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(80, 0);
this.panel3.Name = "panel3";
this.panel3.Padding = new System.Windows.Forms.Padding(0,
2, 30, 3);
this.panel3.Size = new System.Drawing.Size(212, 25);
this.panel3.TabIndex = 9;
//
// lblPassword
//
this.lblPassword.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.lblPassword.Location = new System.Drawing.Point(3,
131);
this.lblPassword.Name = "lblPassword";
this.lblPassword.Size = new System.Drawing.Size(76, 16);
this.lblPassword.TabIndex = 34;
this.lblPassword.Text = "Password :";
//
// lblUsername
//
this.lblUsername.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.lblUsername.Location = new System.Drawing.Point(3,
106);
this.lblUsername.Name = "lblUsername";
this.lblUsername.Size = new System.Drawing.Size(76, 16);
this.lblUsername.TabIndex = 38;
this.lblUsername.Text = "User name :";
//
// lblDatabase
//
this.lblDatabase.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.lblDatabase.Location = new System.Drawing.Point(3,
55);
this.lblDatabase.Name = "lblDatabase";
this.lblDatabase.Size = new System.Drawing.Size(76, 16);
this.lblDatabase.TabIndex = 37;
this.lblDatabase.Text = "Database :";
//
// lblDSN
//
this.lblDSN.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.lblDSN.Location = new System.Drawing.Point(3, 81);
this.lblDSN.Name = "lblDSN";
this.lblDSN.Size = new System.Drawing.Size(76, 16);
this.lblDSN.TabIndex = 36;
this.lblDSN.Text = "DSN :";
//
// panel1
//
this.panel1.Controls.Add(this.lblUsername);
this.panel1.Controls.Add(this.lblDatabase);
this.panel1.Controls.Add(this.lblDSN);
this.panel1.Controls.Add(this.lblPort);
this.panel1.Controls.Add(this.lblPassword);
this.panel1.Controls.Add(this.lblHostname);
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(80, 273);
this.panel1.TabIndex = 7;
//
// lblPort
//
this.lblPort.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.lblPort.Location = new System.Drawing.Point(3, 29);
this.lblPort.Name = "lblPort";
this.lblPort.Size = new System.Drawing.Size(76, 16);
this.lblPort.TabIndex = 35;
this.lblPort.Text = "Port :";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
13F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.panel7);
this.Controls.Add(this.panel6);
this.Controls.Add(this.panel5);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Form1";
this.panel7.ResumeLayout(false);
this.panel7.PerformLayout();
this.panel6.ResumeLayout(false);
this.panel6.PerformLayout();
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.TextBox txtDatabase;
private System.Windows.Forms.Label lblHostname;
private System.Windows.Forms.TextBox txtHostname;
private System.Windows.Forms.TextBox txtUsername;
private System.Windows.Forms.Panel panel7;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.TextBox txtDSN;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label lblPassword;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lblUsername;
private System.Windows.Forms.Label lblDatabase;
private System.Windows.Forms.Label lblDSN;
private System.Windows.Forms.Label lblPort;
===================================================================
 
S

Stoitcho Goutsev \(100\)

V&G,

You need to post a simple and compilable source that demonstrate the issue.
I believe the problem is not in the intialization, but rather in some other
parts of the program e.g. events or a proerty setter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top