TheBoubou
TheBoubou

Reputation: 19903

Winform application freeze

I have Winform application,which does some operation in loops (file access, copy file, ....). During theses operation, the application freeze completely, the job is done but impossible to move the main window or refresh the RichTextBox information (we display errors and the job in progress).

Do you have an idea how to do this ?

Thanks,

Upvotes: 0

Views: 699

Answers (3)

alexm
alexm

Reputation: 6882

Consider using BackgroundWorker.

http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

It can both run your code in the background and report progress back to to the main UI thread.

Upvotes: 2

John Woo
John Woo

Reputation: 263723

i suggest that you use a Background Worker and let the worker do the loops. i think your application read a file by line and added to the rich textbox control right?

this article will guide you in using BackGround Worker. or this

Upvotes: 1

Nakul Chaudhary
Nakul Chaudhary

Reputation: 26164

You can create separate thread and execute other task or may use background worker thread.

Upvotes: 0

Related Questions