“InitializeComponent”方法中的代码由设计者生成,不应手动修改。请删除所有更改并尝试再次打开设计器。
我是这方面的新手,所以请多多包涵。我复制并粘贴了一些表格并立即收到此错误。所以我登录到编写程序的人的计算机,重复这些步骤,但没有帮助。
如果您愿意,我将新表格中的所有内容都更改为 FormA 到 FormB。我不想含糊其辞,但是程序太大了,我什至不知道在此处粘贴什么。
我不断遇到组件和/或初始化组件的问题,我不知道这意味着什么。我也太陌生了,无法理解其他 StackOverflow 解决方案是什么。我尝试删除 Designer.cs 并没有帮助。它不是网络表单。这是一个带有 SQL 后端的 C# 程序。
这是一些代码。我不确定这是否有帮助。我有 8000 个错误。我认为这与此有关。
public FormA()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterScreen;
}
我也在这里遇到错误。它是红色下划线 bool 和 compoents.Dispose
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
我也收到很多关于 FormA 的错误。(不叫那个,我只是为了清楚起见。) FormA.textA 和 FormA.textA 之间的歧义(是的,它是相同的,但它与原始版本编译得很好。)
谁能帮我?谢谢。
编辑:为 Amy 添加开始代码
public partial class FormA : Form
{
string dbname = @"SERVER = np:PROD; DATABASE = TEMP; Integrated security = true; Enlist = false";
string user = Environment.UserName.ToString();
System.Windows.Forms.Timer tmr = new System.Windows.Forms.Timer();
System.Windows.Forms.Timer IdleTimer = new System.Windows.Forms.Timer();
public FormA()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterScreen;
}
private void FormA_Load(object sender, EventArgs e)
{
Application.Idle += new EventHandler(Application_Idle);
this.KeyPreview = true;
btnSched.Text = "Edit " + DateTime.Now.ToString("MM/dd/yyyy") + " Schedule";
calendarRefresh();
tmr.Interval = 1000;//ticks every 1 second
tmr.Tick += new EventHandler(tmr_Tick);
tmr.Start();
loadCurrentlyDisplayed();
createUser();
refreshUsers();
loadNotes();
}
在此之后,它只是一个又一个功能地做各种事情。我可以添加更多,但我不知道我有多少空间。