BackgroundWorker thread to Update WinForms UI

前端 未结 2 1317
星月不相逢
星月不相逢 2021-01-22 20:24

I am trying to update a label from a BackgroundWorker thread that calls a method from another class outside the Form. So I basically want to do this:

MainForm.co         


        
2条回答
  •  情书的邮戳
    2021-01-22 21:04

    Try to invoke the method.

    For Example:-

    this.Invoke((Action)(() => Resources.xobjMF.Enabled = true));
    

提交回复
热议问题