title: Creating Controls in a Class File
body: <p>I selected Class Library option in C# Vis Studio Express to create a DLL which holds heaps of my commonly-used methods etc...</p>
  
  <p>I'm trying to create a textbox in the class file, so that when I add the dll to another project all i have to type is:</p>
  
  <p>MyControls.Create(TextBox);</p>
  
  <p>...And it will create a text box and return it to me and then i can add it to the form.</p>
  
  <p>I know how to create classes etc, so , my quesiton is... Why can't I use System.Windows.Forms is a class file? I have the following in my Class1.cs file:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace MyControls
  {
      public class class1
      {
          public object Create(object control)
          {
              System.Windows.Forms.TextBox t = new System.Windows.Forms.TextBox();
              // textbox properties go here etc...
  
              return control;
          }
      }
  }
  </code></pre>
  
  <p>BUT the red squigly lines keep telling me that "The type of namespace 'Windows' does not exist in the namespace 'System' (Are you missing an assembly reference)?"</p>
  
  <p>Have I forgotten to add something here...??</p>
  
  <p>Thank you :)</p>