title: Checking if tabpage exists, then create a new one if it doesn't
body: <p>This is my coding </p>
  
  <pre><code>Thread groupid = new Thread(() =&gt; 
  {
          while(true)
          {
              GroupIds.ForEach(delegate(String name)
              {
                  if (tabControl1.TabPages.ContainsKey(name))
                  {
                  }
                  else 
                      tabControl1.TabPages.Add(name);
              });
          }
  });
  </code></pre>
  
  <p>For some reason, if I start the thread (which this loop checks if a new value in the list appears, then creating a new page. This code works to the point, it will show a new tab created with the value, then after about 1 second it says "Project is unresponsive" a.k.a it crashed. So I don't know how to fix it, I've tried !tabControl1.TabPages.Contains(name), and a different looping style. Even without the thread, it makes the new page then crashes immediately.</p>