Co-variant array conversion from x to y may cause run-time exception

前端 未结 7 1351
感动是毒
感动是毒 2020-12-23 15:37

I have a private readonly list of LinkLabels (IList). I later add LinkLabels to this list and add those

相关标签:
7条回答
  • 2020-12-23 16:20

    The issue's root cause is correctly described in other answers, but to resolve the warning, you can always write:

    _list.ForEach(lnkLbl => flPanel.Controls.Add(lnkLbl));
    
    0 讨论(0)
提交回复
热议问题