While vs gives us a lot of controls to use, sometimes these controls still don't meet our requirements, such as we want to personalize some of the controls, such as beautifying the controls, and then need to draw the controls yourself or modify them on the basis of the original controls.
There are three types of custom controls
1, combined control (Compositecontrols): Based on the original control according to the needs of the combination
2. Extended control (Extendedcontrols): Inherit from the original control, add some new properties and methods, draw some new elements
3. Custom Control (CustomControls): The drawing of the control is all user-defined
1. Combined controls
Create a new project and drag into the desired control, just as you would in a form
Compile builds to see the appearance of the control
The corresponding control library file can be found in the generated directory CompositeControl.dll
So the DLL for the combined control is ready, and the usage is followed by
2. Extended controls
First, add a class library
Referencing two namespaces System.Drawing and System.Windows.Forms, class renamed to Buttonex, inherited from button
Note that after the extension control is compiled, the visual tools cannot be called to view, only the DLL files are generated and need to be introduced into the project for use in order to see
3. Custom Controls
Custom controls are added in the same way as extended controls, except that the last class inherits from the control class.
The next step is to introduce the control library into the project using
If the project and the Control Library project are in the same solution, the control is automatically introduced to the Toolbox
If you are in a different project
Browse to select a library file, and then hook the control
To drag a control onto a form
Excerpted from http://www.cnblogs.com/bomo/archive/2012/12/09/2810559.html
WinForm Creating a custom control