title: Add button from code
body: <p>I'm trying to add a button to the form using code and iv'e looked it up on the internet but nothing works.</p>
  
  <pre><code>public void addSnake()
  {
      Button btn = new Button();
      btn.Location = new Point(360, 390);
      btn.Size = new Size(10, 10);
      btn.Text = "";
      btn.Name = num + "";
      btn.Tag = this.oneD;
      btn.IsAccessible = false;
      Controls.Add(btn);
  }
  
  public Point getPoint()
  {
      Button btn = (Button)Controls.Find(num + ""); 
      return this.pos; //temporary
  }
  </code></pre>
  
  <p>it says "The name 'Controls' does not exist in the current context". (for both functions)</p>
  
  <p>Note: the functions addSnake and getPoint are inside a Class I made</p>
  
  <p>Full code here: <em>deleted</em></p>