Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > TRACK A THREAD WITH A PROGRESSBAR
 

TRACK A THREAD WITH A PROGRESSBAR

Is it possible to track a threads progress using a progressbar? If so can someone give me an example, or at least tell me where to start looking.

I have a thread that performs a rather lengthy SQL insertcommand. I would like to be able to display its progress.
MigrationUser 1  Thursday, December 16, 2004 5:49 PM
I don't remember exactly how was it in VS2003 but in VS2005Beta you would do it like this :
- use a BackgroundWorker compoent. In its DoWork method put your code that it takes long times to execute. When a certain step is finished (when you want the progress bar to increment) call the ReportProgress method of the backgroundworker. This will fire the ProgressChanged event. Thus you need to add to the ProgressChanged method the code to increment the progressbar.

There is some article in msdn.microsoft.com but i don't seem to find it right now.
MigrationUser 1  Thursday, December 30, 2004 4:20 AM

You can use google to search for other answers

Custom Search

More Threads

• Update DataGridView from another form
• DataGridView - Sort column after DataSource binding.
• Crystal Report Memo field Printing Problem due to length
• Display AND Update, Relationship-Data in one DataGridView?
• Overriding Application Settings (now with example app)
• Binding CompboBox after form has loaded
• Problem with DataGrid in Inherited Form
• Simple Binding Exemple - link 2 boolean properties
• Bind xml file to listbox
• ComboBox Sync With DataGridView