title: Unable to update main form control from subclass
body: <p>Attempt #2.</p>
  
  <p>I'm attempting to call functions within two classes. One function to obtain data and call function B in class B to display the data through a Windows Form application.     </p>
  
  <pre><code>    //Class B containing function B
  using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace GUI_Server
  {
      public partial class ChatServer : Form
      {
  
          private delegate void EnableDelegate(bool enable);
          private static ChatServer CHT = new ChatServer();
  
          public ChatServer()
          {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
              ServerBackBone.test();
          }
  
          public static void TestConnectivity(string text)
          {
              CHT.TestLabel.Text = text;
          }
      }
  } // Assume Class B
  </code></pre>
  
  <p>and the following is Class A and function A</p>
  
  <pre><code>   using System;
  using System.Net;
  using System.Net.Sockets;
  using System.Text;
  using System.Threading;
  
  
  namespace GUI_Server
  {
      class ServerBackBone
      {
  
  
          private static ChatServer CHT = new ChatServer();
          public static void test()
          {
              ChatServer.TestConnectivity("test");
  
  
          }
  
  
      }
  }
  </code></pre>
  
  <p>So, what is going on here is that the form is being loaded, calling a static function within class A to contact class B > function B to update a label on the main window... The problem lays with updating the label with the new text. </p>
  
  <p>Stepping through the code shows that all functions are successfully called &amp; expected text is passed through to the function. </p>
  
  <p>Although, when pressing F5 to start debugging said application, Diagnostic tools show the following message: </p>
  
  <blockquote>
    <p>The diagnostic tools failed unexpectedly</p>
  </blockquote>
  
  <p>The diagnostic hub output shows: </p>
  
  <blockquote>
    <p>Response status code does not indicate success: 401 (Unauthorized).</p>
  </blockquote>
  
  <p>General output shows: </p>
  
  <blockquote>
    <p>The thread 0x20c0 has exited with code 0 (0x0).</p>
    
    <p>The thread 0x1624 has exited with code 0 (0x0).</p>
    
    <p>'GUI Server.vshost.exe' (CLR v4.0.30319: GUI Server.vshost.exe):
    Loaded 'c:\users\shaiya\documents\visual studio 2015\Projects\GUI
    Server\GUI Server\bin\Debug\GUI Server.exe'. Symbols loaded.</p>
    
    <p>The thread 0x20fc has exited with code 0 (0x0).</p>
    
    <p>The thread 0xae8 has exited with code 0 (0x0).</p>
  </blockquote>
  
  <p>Application successfully runs after these messages show. Stepping through shows now errors, nor do breakpoints. Label is not updated in the main control either </p>
  
  <p>Completely new project. Only element on the actual form interface is the label with the property renamed to TestLabel.</p>
  
  <pre><code> this.TestLabel = new System.Windows.Forms.Label();
              this.SuspendLayout();
              // 
              // TestLabel
              // 
              this.TestLabel.AutoSize = true;
              this.TestLabel.Location = new System.Drawing.Point(43, 70);
              this.TestLabel.Name = "TestLabel";
              this.TestLabel.Size = new System.Drawing.Size(35, 13);
              this.TestLabel.TabIndex = 0;
              this.TestLabel.Text = "label1";
  </code></pre>