Stacker
Stacker

Reputation: 8237

Windows Forms GUI Stuck

lets say you are adding a feature to an old and running windows form application now the whole application is running in one thread and the application is really big and have many forms so you cant refract it to run in multithreads, now the application gui freeze everytime you make a process , is there is any way to have an indicator that its loading or in progress while its freezing ? without changing the whole design of the software to support threads etc ?

by the way i dont want it to stop freezing its ok to freeze i just want it to to indicate that its doing something !

any idea would be appreciated, thanks...

Upvotes: 0

Views: 814

Answers (2)

devnull
devnull

Reputation: 2860

You can set the form's Cursor property to Cursors.WaitCursor upon starting the long running action, and reset it to Cursors.Default upon finish. While your action executes you can call Application.DoEvents() but it may cause side effects if other events trigger in the mean time.

Upvotes: 1

TalentTuner
TalentTuner

Reputation: 17556

See BackGroundWorker componet if application is written using .net 2.0 or higher version.

Upvotes: 1

Related Questions