public progressPopup(string title, int usepic, string strlbMsg, Bitmap backgroundImg, progressPopup.ProcessInThread process, object param, int ifcloseDlg) { this.InitializeComponent(); this.m_title = title; this.m_usepic = usepic; this.m_opt = ifcloseDlg; this.Text = this.m_title; this.lbMsg.Text = strlbMsg; this.theProcess = process; this.m_param = param; if (backgroundImg != null) { this.BackgroundImage = backgroundImg; } switch (this.m_usepic) { case 0: this.labLoading.Show(); break; case 1: this.pictureBoxLoading.Show(); break; case 2: this.progressBar1.Minimum = 1; this.progressBar1.Maximum = 100; this.progressBar1.Value = 1; this.progressBar1.Step = 1; this.progressBar1.Show(); break; } System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(this.startThread)); }
public progressPopup(string title, int usepic, string strlbMsg, Bitmap backgroundImg, progressPopup.ProcessInThread process, object param, progressPopup.ProgramBarThread pProgramBarThread, int ifcloseDlg) { this.InitializeComponent(); this.m_title = title; this.m_usepic = usepic; this.m_ProgramBarThread = pProgramBarThread; this.m_opt = ifcloseDlg; this.Text = this.m_title; this.lbMsg.Text = strlbMsg; this.theProcess = process; this.m_param = param; if (backgroundImg != null) { this.BackgroundImage = backgroundImg; } switch (this.m_usepic) { case 0: this.labLoading.Show(); break; case 1: this.pictureBoxLoading.Show(); break; case 2: this.progressBar1.Minimum = 1; this.progressBar1.Maximum = 100; this.progressBar1.Value = 1; this.progressBar1.Step = 1; this.progressBar1.Show(); break; } System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(this.startThread)); this.setbarTimer = new System.Timers.Timer(); this.setbarTimer.Elapsed += new ElapsedEventHandler(this.setbarTimer_Elapsed); this.setbarTimer.Interval = 1000.0; this.setbarTimer.Enabled = false; if (pProgramBarThread != null) { this.setbarTimer.Enabled = true; } }