See Also: UserControl Members
The System.Windows.Forms.UserControl gives you the ability to create controls that can be used in multiple places within an application or organization. You can include all the code needed for validation of common data you ask the user to input; some examples of this are e-mail addresses (see Example section), telephone numbers, and postal codes. Another efficient use of the user control is to simply preload a System.Windows.Forms.ComboBox or System.Windows.Forms.ListBox with static items you commonly use in almost every application; some examples of this are countries/regions, cities, states, and office locations. For more information about authoring custom controls, see Developing Windows Forms Controls with the .NET Framework.
You might consider creating a namespace that contains several classes of user controls and compiling it into one DLL. This DLL can be referenced and distributed with the application or all applications within an organization. This gives you the ability to reference the user control in many applications and save time laying out and coding the contained elements of the user control. A user control also gives you consistency within or across applications; for example, all address information input blocks will all have the same appearance and behavior. Consistency gives your application a more polished and professional appearance.
You can host Windows Forms System.Windows.Forms.UserControl derived classes inside of a form, on another System.Windows.Forms.UserControl, inside of Internet Explorer on a Web page, or inside a System.Windows.Forms.WebBrowser control hosted on a form.
When hosting a System.Windows.Forms.UserControl inside of the System.Windows.Forms.WebBrowser control, you cannot turn off Visual Styles using the META tag value MSThemeCompatible. For more information about Visual Styles, see Rendering Controls with Visual Styles.
Note that for Smartphone applications, this control requires Windows Mobile Version 5.0 software for Smartphones.