title: Threading with Callback example does not work.
body: <p>I am working on this example, but I am unable to mesh the callback and the threading.
  What I want is this.<br>
   1) Press button
   2) Start the progress bar running
   3) Call to a new thread to perform some long running process
   4) A callback on the long running process should trigger the progress bar to stop.</p>
  
  <p>Below I have something...Although the callback parameter for DoSomethingInThread comes in as null.
  The StopProgressBar() acts on the ProgressBar control,  so it cannot be static.</p>
  
  <pre><code>    static bool done;
      static readonly object locker = new object();
      static ParameterizedThreadStart threadStarter = new ParameterizedThreadStart(DoSomethingInThread);  
      private Thread workerThread = new Thread(threadStarter);
      public delegate void StopProgressBarCallback()
  
      public Form1()
      {
          InitializeComponent();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          StartProgressBar();
          workerThread.Start();
      }
  
      static void DoSomethingInThread(object callback)
      {
          StopProgressBarCallback stopper = callback as StopProgressBarCallback;
          lock (locker)
          {
              Thread.Sleep(5 * 1000);
          }
          stopper();
      }
  
      private void StartProgressBar()
      {
          progressBar1.MarqueeAnimationSpeed = 30;
          progressBar1.Style = ProgressBarStyle.Marquee;
      }
  
      public void StopProgressBar()
      {
          progressBar1.Style = ProgressBarStyle.Continuous;
      }
  </code></pre>