父窗体代码
private void DGUserEdit() { if(DGUser.SelectedItem!=null) { DataRow dr = (DGUser.SelectedItem as DataRowView).Row; Page.UserEdit UE = new UserEdit(UserGrade, dr["UserName"].ToString());//声明子窗体 UE.Closed += new EventHandler(UE_Closed);//注册关闭事件 UE.ShowDialog(); } } //在子窗体的关闭里写要刷新的内容,我这是重写绑定 private void UE_Closed(object sender,EventArgs e) { Band(); }