I have created a simple archiving program. The zipping part of the archive program takes a while to finish. People who are using the program thinks that it freezes because when they click on it several time it say's not responding. It works if you just let it do it's thing. So I thought I better incorporate some things to tell the user what it's currently working on and the percent complete it is on all of them. So I put 2 labels on the form. One say's zipping and the other is suppost to show the file being zipped. The problem is that the form will not refresh when I type label4.Text = tmpVal; but when I put a message box right before it that just say's MessageBox.Show("Ok"); it refreshes. It's annoying to click the ok box 100 times so I would just like to know a more simple way to refresh the form1 box so that it displays the new text that I send it.

How to Refresh the form?
Patrick Barnes
What about instead implementing a little bit of threading where your archiving is going on in a background thread and sends periodic events to the main form to update it’s progress
This way the main form never appears stalled and your work still continues in the background.
Jereme Guenther
hi,
you can use Application.DoEvent() to force the message to be showen if this still to fast to catch use System.Threading.Thread.Sleep(duration in milliseconds like 1000 for one second)
this slow down your application but show the user whats going on
hope this helps
Daniel Booth ACITP
hi,
the normal way to do that is to show the user a new form just has a lable and a progress bar like the copy file dialog
when you have recursive method this some how freez the GUI, and doesn't respond to the user till it finish, so you have to force your program to show result to the user the only way that i know is "forexample"
label1.text = currentfilename;
progressbar.value += 1;
application.doevent();
system.threading.thread.sleep(100);
that will force the application to change the gui and will wait for 1/10 of second for the user to notice the changes
you can use threads also in doing that but i prefer the above way particulary in this case
hope this helps
flash77
juffowup
Thanks this worked. I luckily didn't need to use the sleep command. Thanks for your help.