title: Thread cross class add item listbox
body: <p>I have a problem with threads in combination with classes.
  For my question I have made a simple code to explain my problem.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  using System.Threading;
  
  namespace RemoteMonitorServer
  {
      public partial class RemoteMonitor : Form
      {
          Thread cThread;
          Server cServer;
  
          public RemoteMonitor()
          {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
              WriteLog("Programm started!");
  
              cServer = new Server();
              cThread = new Thread(new ThreadStart(cServer.StartServer));
              cThread.IsBackground = true;
              cThread.Start();
          }
  
          public void WriteLog(string sText)
          {
              MessageBox.Show(sText);
              listBox1.Items.Add(sText);
          }
      }
  }
  </code></pre>
  
  <p>The class has the following code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace RemoteMonitorServer
  {
      class Server
      {
          public void StartServer()
          {
              RemoteMonitor cTest = new RemoteMonitor();
  
              cTest.WriteLog("Thread started!");
          }
      }
  }
  </code></pre>
  
  <p>Now, when I start this code, the listbox does get "Programm started!" but not "Thread started!".
  Although I get two MessageBox messages, so I believe the method is being called.
  There is no error in Visual Studio 2010, can someone please tell me what I'm doing wrong here?</p>