The following diagram shows the inheritance hierarchy of components in the System.Win Forms namespace.
Win Forms has two base classes for controls:
Note Controls written specifically for Win Forms should derive from RichControl.
The code fragment below defines a custom control named FlashTrackbar, that can be used to track the progress of an application.
[C#] public class FlashTrackBar : RichControl {…}
You can customize any existing Win Forms control by deriving from it and overriding its properties and methods as described in Extending an Existing Win Forms Control.
If you want to create a composite control by grouping together other controls, your control should derive from System.WinForms.UserControl. Details are provided in Creating a Composite Win Forms Control. Deriving from UserControl will ensure that your composite control will work not only in Win Forms, but also in Internet Explorer 5.0 and higher as well as in Visual Basic 6.0. The base class of UserControl, System.WinForms.ContainerControl understands keyboard routing so that child controls work as a group.