通用等待窗口

1:
2. 方法

public static void ShowWait<T>(this Form form, string caption="请等待", string description="加载中...")
{
  SplashScreenManager splashScreenManager = new SplashScreenManager(form, typeof(WaitForml), true, true);
  splashScreenManager.ShowWaitForm();//显示加载等待窗体 
  splashScreenManager.SetWaitFormCaption(caption);
  splashScreenManager.SetWaitFormDescription(description);
  //ProductForm productForm = new ProductForm();
  //productForm.Show ():
  Type type = typeof(T);//ProductForm检测类型
  Form f=(Form)Activator.CreateInstance(type);  //new 
  f.Show();
  splashScreenManager.CloseWaitForm();
}

posted on 2023-04-30 22:46  manber  阅读(7)  评论(0)    收藏  举报

导航