C# Child Form Inheriting a Control from Parent Form

835 views Asked by At

The way my application is organized is I have a base form and multiple child forms that inherit from it. I also have a button defined as a UI control. I want to add the UI control to the base form so all the child forms can also have that control. However, I don't want to mess with all the individual child forms because the control should be the same for all of them. What I have done so far: Added the control to the designer of baseFrom.cs, which in turn created a InitializeComponent() function in the base form that listed all the properties of the control. I have tried calling the InitializeComponent in the base form's constructor but that still does not make the control appear in any of the child forms. What am I missing here?

1

There are 1 answers

0
Giorgi_Mdivani On

after you add control to base form you need to build solution and then control will appear in inherited forms