委托原来还能这么用,唉 发现自己会的太少了...
public class MyDelegate
{
public delegate void MyStart();
public delegate void MyEnd();
}
public class Form1 : Form
{
public Form1()
{
InitializeComponent();
Start = s;
End = e;
}
public MyStart Start
{
get;
set;
}
public MyEnd End
{
get;
set;
}
//
private void Form1_Load(object sender, EventArgs e)
{
start();
end();
}
void s()
{
MessageBox.Show("start");
}
void e()
{
MessageBox.Show("end");
}
}