无法将类型'string'隐式转换为'System.Windows.Forms.TextBox' [英] Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'

查看:146
本文介绍了无法将类型'string'隐式转换为'System.Windows.Forms.TextBox'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道该怎么办,因为该错误出现在 Form1.Designer.cs 中,并且因为我没有调试程序那部分的经验.

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);

推荐答案

此错误.Name="Form1";

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

我怀疑您已经创建了一个名为 Name 的控件,该控件与窗口的 Name 属性冲突.只需将控件重命名为其他名称,它就可以再次工作.

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.

这篇关于无法将类型'string'隐式转换为'System.Windows.Forms.TextBox'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆