How to program asynchronous Windows Forms Applications?

Posted by Nestor on Stack Overflow See other posts from Stack Overflow or by Nestor
Published on 2009-10-04T20:47:13Z Indexed on 2010/03/28 23:23 UTC
Read the original article Hit count: 356

Filed under:
|
|
|

I'm writting a Windows Forms application in C# that performs a lot of long-running procedures. I need to program the application so that the GUI doesn't lock. What is the best way to program it?

I know how to use the following:

  1. BeginInvoke/EndInvoke
  2. Calling Application.DoEvents() repeatedly (probably not a good idea)
  3. BackgroundWorker
  4. etc.

But how to manage GUI state with call backs, etc... is not trivial. Are there solutions for this (in the form of patterns or libraries)?

© Stack Overflow or respective owner

Related posts about winforms

Related posts about c#