日期:2014-05-20 浏览次数:21129 次
#region 调用后台线程执行打印操作 begin Thread threadPrint = [color=#FF0000]new Thread(new ParameterizedThreadStart(PrintBarCode));[/color] threadPrint.IsBackground = true; threadPrint.Start(this.dgvPiLiang); //threadPrint.Join(); #endregion 调用后台线程执行打印操作end
private void PrintBarCode(DataGridView dgvTemp) { if (dgvTemp.InvokeRequired) { PrintBarCodeDeleg printDeleg = new PrintBarCodeDeleg(PrintBarCode); dgvTemp.BeginInvoke(printDeleg, dgvTemp); } else { . . . }
Thread threadPrint = new Thread(new ParameterizedThreadStart(PrintBarCode)); threadPrint.IsBackground = true; threadPrint.Start(this.dgvPiLiang); => Thread threadPrint = new Thread(_=>{PrintBarCode(this.dgvPiLiang);}); threadPrint.IsBackground = true; threadPrint.Start();