title: How to access GUI elements from a class in C#?
body: <p>I have windows application in C# and have a richtextbox in the GUI. I want to reach the richtextbox and append some text to it from inside a class. I thought about creating a static RichTextBox item in the form's code file and then call it like this:</p>
  
  <pre><code>public partial class Form1 : Form
  {
      public static RichTextBox box;
  
      public Form1()
      {
          box = richtextbox_in_gui;
      }
  }
  
  public class SomeClass()
  {
      Form1.box.AppendText("...");
  }
  </code></pre>
  
  <p>Is that a safe way to do it? Or is there any other way i can do this?</p>
  
  <p>Thanks</p>