Have 2 forms, show application progress without hanging UI

teixeira

Regular
Joined
Apr 5, 2005
Messages
94
Location
LEIRIA-PORTUGAL
Hi all,

I have two forms the first processes a big amount of information, and the second is na progress forms informing the user the progress of this processing.
When i call the progress form, from the main form and i try to write in its progressbar, i get the interface very slow and the apolication hang up and stays bloced, give the idea that the program is not responding, how can i use this functionality by without hang up the app.?
I tried to use Application.DoEvents() but it does't solve the issue.

Any help, will be appreciated,
TIA
Tiago Teixeira
 
Are you using two threads? One for the work, the other for the display?

If you are using .Net 2.0 this can be easily achieved with the BackgroundWorker component.
 
No, im using for now 1 thread, the UI thread itself.
I cannot understand yet how backgroundworker works very welll.

I wanna update the splash screen with current processing information , in a label and i wanna pass a percentage value to increment in the progressbar as well as.

Can you please do me a simple example about this?

TIA,

Tiago Teixeira
 
I'm adding comments to some sample code I'll post up for you.

Edit: See the attached code sample. I hope C# works for you. Everything should work without any problems...so if there are just let me know. Feel free to ask any questions.
 

Attachments

Last edited:
Thanks a lot for the nice sample. It took me doughts off.
I was a little confused, abou how to do this, but with your nice coments i got it all.

Regards and nice weekend,

Tiago TEixeira
 
Back
Top