In C#, wait on the mainthread while continuing to process UI updates? (.NET 2.0 CF)

前端 未结 10 2184
梦谈多话
梦谈多话 2020-12-18 11:49

I want to otherwise block code execution on the main thread while still allowing UI changes to be displayed.

I tried to come up with a simplified example version of

10条回答
  •  温柔的废话
    2020-12-18 12:27

    I agree with the others that are suggesting you use Background Worker. It does the heavy lifting and allows the UI to continue. You can use the Report Progress of Background Worker to initiate times where the Main Form can be set to be disabled while it performs the actions in the background and then re-enable once the 'certain instances' have completed processing.

    Let me know if this helps! JFV

提交回复
热议问题