How to start a thread to keep GUI refreshed?

前端 未结 4 1052
梦毁少年i
梦毁少年i 2021-02-11 03:04

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:54

    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.

提交回复
热议问题