public class WaitFormManager { private Thread waitFormThread; public WaitFormManager() { waitFormThread = new Thread(new ThreadStart(OpenWaitform)); } public void ShowWaitForm() { if (!waitFormThread.IsAlive) { waitFormThread.Start(); } } public void HideWaitForm() { if (waitFormThread.IsAlive) { waitFormThread.Abort(); } } private void OpenWaitform() { WaitForm wf = new WaitForm(); wf.Show(); //wf.Update(); } }
public static WaitFormManager wfm = new WaitFormManager(); wfm.ShowWaitForm(); //Here we get some stuff done System.Threading.Thread.Sleep(2000); wfm.HideWaitForm();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)