求助帖,关于重载的方法与委托不匹配,如何解决???代码如下:
#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();