Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'

Tags:

c#

I don't know what to do because the error is in the Form1.Designer.cs and because I have no experience in debugging that part of the program.

//Form1
// 
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(352, 246);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Generate Username";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
like image 447
YellowSubmarine Avatar asked Jan 29 '14 14:01

YellowSubmarine


Video Answer


1 Answers

The error is on this.Name = "Form1";

I suspect you have created a control named Name, which conflicts with the Name property of the window. Just rename the control to something else and it should work again.

like image 136
Thomas Levesque Avatar answered Oct 08 '22 08:10

Thomas Levesque