Click here to Skip to main content
15,884,062 members
Articles / Desktop Programming / Windows Forms
Alternative
Tip/Trick

Wait progress bar for long running UI operations

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
7 Oct 2011CPOL 9.1K   1
The background method is probably the most preferred method, but I've found this one is very easy to implement, and it's just one short line:BeginInvoke(new Action(() => progressBar1.Increment(1)));Place this in your worker thread to report to the UI. Not sure how "good" this is, but it...
The background method is probably the most prefered method, but I've found this one is very easy to implement, and its just one short line:

C#
BeginInvoke(new Action(() => progressBar1.Increment(1)));


Place this in your worker thread to report to the UI. Not sure how "good" this is but it works well in a small image conversion program i wrote.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralSo you will end up waiting if process completes or showing u... Pin
kris44427-Oct-11 0:54
kris44427-Oct-11 0:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.