Background – For a winforms 3.5 c# application, I would like to keep the main window fully painted/responsive during a long running synchronous request. For example if the user moves the window.
Question – Is there a way to achive this WITHOUT having to setup a separate thread or backgroundworker process? (e.g. like a way to call from within my long running transaction, “release a bit of CPU to mainform”, at some points)
thanks
Synchronous means, by definition, that the call blocks until completion. If you block on the UI thread, then there is no way to keep the UI responsive at the same time. You can keep it painted, using the
Control.Invalidatefollowed byControl.Updatemethod, but it will still not be responsive to user input.It’s so easy to slap a
BackgroundWorkeron a form; why would you want to come up with clumsy workarounds anyway?