Visual Inheritance
After all the settings and behavior and layout details you've learned to pack into forms in this chapter, you may decide that you'd like to keep some of your hard work in a Form-derived base class for easy reuse by further derivations, and you can certainly do that. If you follow the convention that forms initialize their own properties and the properties of their child controls in a function called InitializeComponent, the Designer provides direct support for your visual inheritance: the reuse of a form base class via inheritance.
Parent MenuItem | MergeType | MergeOrder |
---|---|---|
File | MergeItems | 0 |
| Add | 0 |
| Add | 2 |
Window | Add | 2 |
Child MenuItem | MergeType | MergeOrder ... |
---|
Get Windows Forms Programming in C# 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.