Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
There are two contexts in which controls have to operate: design time and runtime. Design time refers to when the control is being displayed in the Forms Designer. Runtime simply means normal execution of a program that uses the control.
Controls do not need to provide any explicit support to allow the Forms Designer to host them. As we saw in Chapter 5, even a very simple custom control derived directly from System.Windows.Forms.Control with nothing more than an override of the OnPaint method added can be dropped onto a form in the Designer. Visual Studio .NET just creates an instance of the control to render it in the Designer. It uses the normal control painting mechanisms to do this, so controls do not need any special code to make this work. Selection outlines and resize handles are added by the Forms Designer after the control has drawn itself.