110,548
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 进度条委托方法
/// </summary>
/// <param name="ipos"></param>
private void SetProgressBarDelegate(int ipos)
{
if (this.InvokeRequired)
{
this.Invoke(new DelegateIntoInt(this.SetProgressBarDelegate), new object[] { ipos });
}
else
{
base.toolStripProgressBar1.Value = Convert.ToInt32(ipos);
}
}
/// <summary>
/// 执行主方法
/// </summary>
private void DoMainMethodDelegate()
{
if (this.InvokeRequired)
{
this.Invoke(new DelegateIntoNull(this.myMainMethod), new object[] { });
}
}
this.proBarThread = new Thread(new ThreadStart(this.SetToolStripProgressBar));
this.proBarThread.Start();
//执行主线程方法
this.mainThread = new Thread(new ThreadStart(this.DoMainMethodDelegate));
this.mainThread.IsBackground = true;//后台线程
this.mainThread.Start();