title: Threaded loading (waiting) screen
body: <p>I'm looking for a generic method to implement a wait screen during long operations. I have used threading a few times before, but I have the feeling that I implemented it either very poorly, or with way too much hassle (and copy/pasting - the horror!).</p>
  
  <p>I want to keep this as generic and simple as possible, so I won't have to implement loads of <code>BackgroundWorker</code>s handling all kinds of crap, making things hard to maintain.</p>
  
  <p>Here's what I would like to do -- please note this might differ from what's actually possible/best practise/whatever -- using VB.NET, Framework 2.0 (so no anonymous methods):</p>
  
  <pre><code>  Private Sub HandleBtnClick(sender as Object, e as EventArgs) Handles Button.Click
        LoadingScreen.Show()
  
        'Do stuff here, this takes a while!'
        Dim Result as Object = DoSomethingTakingALongTime(SomeControl.SelectedObject)
  
        LoadingScreen.Hide()
  
        ProcessResults(Result)
    End Sub
  </code></pre>
  
  <p>The application is now completely single-threaded, so everything runs on the GUI thread. I need to be able to access objects in <code>DoSomethingTakingALongTime()</code> without getting cross-thread exceptions. The GUI thread waits for some method (which takes a long time) to complete, while the <code>LoadingScreen</code> Form should stay responsive (it's animated/has a progressbar/etc.).</p>
  
  <p>Is this a doable/good approach or am I seeing this way too simplistic? What is the best practise concerning this matter? And most importantly: how could I implement such a system? As I already mentioned, I have very little experience with threading, so be gentle please :-)</p>