User Controls

Similar to the grouping controls, a user control enables you to group a set of controls. Unlike the grouping controls, a user control allows the group of controls to act as one control. You can create your own properties and events on this control that will affect the way in which the grouped items behave. To better illustrate this point, consider the OpenDialog control. This control has many subcontrols, such as the ListView, TextBox, and Label, and OK and Cancel buttons. When you use the OpenDialog control, you don't write event handlers for all of these controls—they already exist. Similarly, a user control enables you to visually create your own controls by designing the control exactly as you would a form. You can then use ...

Get Microsoft® Visual C#® .NET 2003 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.