title: Access form component from another class
body: <p>I hope that the title and this simple example says everything.</p>
  
  <pre><code>public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  
      public void UpdateLabel(string str)
      {
          label1.Text = str;
         MessageBox.Show("Hello");
      }
  
      private void buttonIn_Click(object sender, EventArgs e)
      {
          UpdateLabel("inside");
      }
  
      private void buttonOut_Click(object sender, EventArgs e)
      {
          MyClass Outside = new MyClass();
          Outside.MyMethod();
      }
  }
  
  public class MyClass
  {
      public void MyMethod()
      {
           Form1 MyForm1 = new Form1();
           MyForm1.UpdateLabel("outside");
      }
  }
  </code></pre>
  
  <p>When I'm trying to change <em>lable1</em> from <em>MyClass</em> it does nothing. But I can get to the <em>UpdateLable</em> method from outside, it says Hello to me, it just doesn't change the label.</p>