日期:2014-05-17 浏览次数:20805 次
public void FillSbjForStudent() { if (bASStudentBindingSource.Current != null) { DataRowView dr = (DataRowView)this.bASStudentBindingSource.Current; BASStudentManager manger = new BASStudentManager(); ThreadStart starter = delegate { manger.FillBASSbjForStudent(this.dsSbjForStudent.BASSbjForStudent, new Guid(dr["StudentID"].ToString())); }; loading.Loading(starter); } } public class BASLoading { public static bool IsOpen = false; public void Loading(ThreadStart starter) { #region 加载数据动态效果 try { TBI.BaseUserControl.FrmLoading frm = new FrmLoading(); IsOpen = false; starter += delegate { while (true) { if (IsOpen) { frm.Close(); break; } } }; Thread th = new Thread(starter); th.Start(); frm.ShowDialog(); } catch(Exception ex) { } #endregion } }