线程问题:线程去做显示某窗体,另一个线程去读写数据,读完之后关闭显示窗体。
功能是这样的,点击某按钮,一个线程去弹出一个半透明的模式船体(窗体上就一张动态图片gif),一个线程去备份数据库数据,备份完成后,关闭模式窗体。

解决方案 »

  1.   

    这个功能用 backgroundWorker就可以实现了 看看这个例子
      

  2.   

    直接使用委托BeginInvoke
    EndInvoke
      

  3.   


    static Thread splash = null; static WaittingForm splashScreen = null;
     public static void showWaitForm()
      {
          splashScreen = new WaittingForm();
          Application.Run(splashScreen);
       }按钮事件中
    splash = new Thread(new ThreadStart(showWaitForm));
                splash.IsBackground = true;
                splash.ApartmentState = ApartmentState.STA;
                splash.Start();
                Application.DoEvents();
                //读数据库
    splash.Abort();