title: How to access Windows form controls in another class
body: <p>I have a form named <code>"Form1"</code> , contains Two controls named <code>"Button1"</code> and <code>"rtDisp"</code> textbox and class named <code>"Class1"</code>. From the class named <code>Class1</code> I want to access <code>Form1</code> control e.g <code>rtdisp</code> to display some text say "abc123" when I click <code>button1</code>.</p>
  
  <p>My code is as under: when I execute the following code it gives me the following error:
   <code>'WindowsFormsApplication1.Class1' does not contain a constructor that takes '1' arguments</code>     </p>
  
  <pre><code>namespace WindowsFormsApplication1
  {
    public partial class Form1 : Form
    {
      public string setcodes
      {
          get { return rtdisp.Text; }
          set { rtdisp.Text = value; }
      }
      private Class1 abc;
      public Form1()
      {
          InitializeComponent();
          abc = new Class1(this);
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
  
          rtdisp.Text = setcodes;
      }
    }
  }
  
  namespace WindowsFormsApplication1
  {
    public  class Class1
    {
      private Form1 v;
      public string abc(Form1 v)
      {
        this.v = v;
        return  v.setcodes = "abc123"; 
      }
    }
  }
  </code></pre>