using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace 窗体事件Load_Click_Closing
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show("已经登陆");
}
private void Form1_Click(object sender,EventArgs e)
{
MessageBox.Show("已经单击事件");
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("是否关闭事件","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
if (dr == DialogResult.Yes)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
}
}
}
出现的错误在在Form1.Designer.cs中this.Load += new System.EventHandler(this.Form1_Load);
我不理解是什么意思
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace 窗体事件Load_Click_Closing
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show("已经登陆");
}
private void Form1_Click(object sender,EventArgs e)
{
MessageBox.Show("已经单击事件");
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("是否关闭事件","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
if (dr == DialogResult.Yes)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
}
}
}
出现的错误在在Form1.Designer.cs中this.Load += new System.EventHandler(this.Form1_Load);
我不理解是什么意思
就是给窗体的Load事件绑定到Form1_Load这个函数上
this.Load += new System.EventHandler(this.Form1_Load);没有删除。
双击错误提示,打开design.cs文件,把它也删除掉。