A窗体
//用委托声明(传一个当前窗体的页面)
public delegate void Determine(AddOperationRulesForm frm);
//用event 关键字声明事件对象
public event Determine DetermineClick;
//在页面做完事,需要关闭窗体是调用
DetermineClick(this);
B窗体
//调用A窗体时
var form = new AddOperationRulesForm(_buildingSysNo);
form.DetermineClick+=form_DetermineClick; //调用事件
form.Show();
private void form_DetermineClick(AddOperationRulesForm frm)
{
frm.Close();
BindingDataSources();
}
原文地址:http://www.cnblogs.com/denglj/p/3862984.html