日期:2014-05-17 浏览次数:20908 次
private void button1_Click(object sender, EventArgs e)
{
Form2 form = new Form2();
form.PassValueEvent += new Form2.PassValue(form_PassValueEvent);
form.ShowDialog();
}
void form_PassValueEvent(string value)
{
textBox1.Text = value;
}
public delegate void PassValue(string value);
public event PassValue PassValueEvent;
private void button1_Click(object sender, EventArgs e)
{
string strReturn=Method();//调用方法;
if(PassValueEvent!=null)
{
PassValueEvent(strReturn);
}
}