定义委托和事件,并且触发这个事件

     //定义委托
        public delegate void ShowOutStockDelegate(List<OutStockResultDto> outStockResultDto);
        //定义事件
        public event ShowOutStockDelegate ShowOutStockEvent;
        private void btnConfirm_Click(object sender, EventArgs e)
        {
             ShowOutStockEvent(outStockResultDtos);
        }

在目标窗体上,实例化上述窗体

FrmEndTask frmEndTask = new FrmEndTask();
//触发这个事件
frmEndTask.ShowOutStockEvent += new FrmEndTask.ShowOutStockDelegate(EndTask_ShowOutStockEvent);
protected void EndTask_ShowOutStockEvent(List<OutStockResultDto> outStockResultDtos)
{
 //这里就能拿到你想要的数据了
_outStockResultDtos = outStockResultDtos;
}

 

  

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2021-04-05
  • 2021-07-13
猜你喜欢
  • 2021-06-01
  • 2021-11-30
  • 2021-05-24
  • 2021-10-10
  • 2022-12-23
相关资源
相似解决方案