How to start a thread to keep GUI refreshed?

前端 未结 4 2046
北恋
北恋 2021-02-11 03:39

I have window with button which triggers lengthy processing. I put processing in a separate thread, but -- to my surprise -- it makes GUI frozen anyway. No control is refreshed,

4条回答
  •  终归单人心
    2021-02-11 03:53

    There are numerous methods to run functions off the UI thread, but the easiest and generally most suitable is to look at the BackgroundWorker component. Many decent tutorials can be found. For example, here.

提交回复
热议问题