title: how to create custom control in visual studio 2015 and add it to toolbox
body: <p>I want to create a control that draw a table in class library project .and add this dll to toolbox and use it in my windows form app. I try and googling but I can't find. 
  what should i do ?</p>
  
  <p>I created this class in class library project </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Drawing;
  using System.Data;
  using System.Windows.Forms;
  namespace ClassLibrary1
  {
  class PanelZ : System.Windows.Forms.Panel
  {
      private Color color1 = Color.SteelBlue;
      private Color color2 = Color.DarkBlue;
      private int color1Transparent = 150;
      private int color2Transparent = 150;
      private int angle = 90;
  
      public Color StartColor
      {
          get { return color1; }
          set { color1 = value; Invalidate(); }
      }
      public Color EndColor
      {
          get { return color2; }
          set { color2 = value; Invalidate(); }
      }
      public int Transparent1
      {
          get { return color1Transparent; }
          set
          {
              color1Transparent = value;
              if (color1Transparent &gt; 255)
              {
                  color1Transparent = 255;
                  Invalidate();
              }
              else
                  Invalidate();
          }
      }
  
      public int Transparent2
      {
          get { return color2Transparent; }
          set
          {
              color2Transparent = value;
              if (color2Transparent &gt; 255)
              {
                  color2Transparent = 255;
                  Invalidate();
              }
              else
                  Invalidate();
          }
      }
  
      public int GradientAngle
      {
          get { return angle; }
          set { angle = value; Invalidate(); }
      }
      public PanelZ()
      {
      }
      protected override void OnPaint(PaintEventArgs e)
      {
          base.OnPaint(e);
          Color c1 = Color.FromArgb(color1Transparent, color1);
          Color c2 = Color.FromArgb(color2Transparent, color2);
          Brush b = new System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, c1, c2, angle);
          e.Graphics.FillRectangle(b, ClientRectangle);
          b.Dispose();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but when i add mydll to toolbox i get this error 
  <a href="https://i.stack.imgur.com/aVS0e.png" rel="nofollow noreferrer">image here</a></p>