private void OnThreadStart() { this.dialogForm = new WaitDialogForm(this.strMainCaption, this.strCaption, this.size); this.dialogForm.Show(); this.bisShow = true; this.bisStart = true; try { while (this.bisStart) { Application.DoEvents(); Thread.Sleep(100); } } finally { this.dialogForm.Dispose(); this.dialogForm = null; } }
public WaitDialog(string maincaption, string caption, Size size) { this.dialogForm = null; //this.dialogForm = new WaitDialogForm(maincaption, caption, size); this.strMainCaption = maincaption; this.strCaption = caption; this.size = size; this.bisShow = true; this.thread = new Thread(new ThreadStart(this.OnThreadStart)); this.thread.Start(); }