teixeira Posted July 28, 2006 Posted July 28, 2006 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 Quote
mskeel Posted July 28, 2006 Posted July 28, 2006 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. Quote
teixeira Posted July 28, 2006 Author Posted July 28, 2006 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 Quote
mskeel Posted July 28, 2006 Posted July 28, 2006 (edited) 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.Threading Experiment.zip Edited July 28, 2006 by mskeel Quote
teixeira Posted July 28, 2006 Author Posted July 28, 2006 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.