Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using custom controls in the Form Designer

Status
Not open for further replies.

RobCozzens

Programmer
Aug 20, 2003
5
US
There are a couple of things to keep in mind when designing a class that inherits from a Control if you want to interact with it in the Form Designer.

First, you have to be able to create it with a zero parameter constructor.

Second, if your Control class has any fields that are also your own classes, they have to inherit from System.ComponentModel.Component to work properly with the Form Designer. -Note: to get your Component class into the form, add an ImageList to your form and then change its type in the code.

Third, if you want your control class to show up in the toolbox, inherit from UserControl. Or make it a dll and add it to the toolbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top