How can I make the progress bar update fast enough?

后端 未结 9 1591
礼貌的吻别
礼貌的吻别 2021-02-08 20:40

I\'m using a progress bar to show the user how far along the process is. It has 17 steps, and it can take anywhere from ~5 seconds to two or three minutes depending on the weath

9条回答
  •  滥情空心
    2021-02-08 20:46

    It sounds like you're doing everything on the UI thread and thus not releasing the message pump. Have you tried using smoething like BackgroundWorker and the ProgressChanged event? See MSDN for an example.

    BackgroundWorker is ideal for loading external data - but note that you shouldn't do any data-binding etc until you get back to the UI thread (or just use Invoke/BeginInvoke to push work to the UI thread).

提交回复
热议问题