Click here to Skip to main content
15,906,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to run a two form in the c#. but what i want is that. if the other form is freezing or loading. the other form are still working. assuming the first form is upload the file and it will freeze due to a large file of upload while the other form will count the elapse minute of uploading. How to code that? i research and do and experiment in c# but it doesn't work. pls help me.
Posted

1 solution

Since usually all Forms run on the "User Interface Thread" a.k.a. "Main Thread", your first form should not freeze in the first place.

Instead, the heavy load should be lifted by a separate thread: BackgroundWorker[^] is your friend here. If you want to prevent user from interfering via first form, you can make the second a modal form[^]. Your BackgroundWorker then reports progress[^] to the second form.
 
Share this answer
 
Comments
Gishisoft 12-Aug-13 2:11am    
how to code it?
lukeer 12-Aug-13 3:57am    
The first link[^] I mentioned contains two examples.
Use the easy one.
Play with it.
Ask specific questions, should they arise.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900