0
votes

I have this problem with Visual Studio 2008 C#. There's a base form and a number of Windows forms that inherit from it. (Yes, I think I've compiled the base form before I tried to inherit from it.)

The derived forms compile smoothly, without errors, but they display only what they inherited from the base form. In other words, all derived forms look and behave exactly like the base form at run time, even though they are different at design time--they have many controls not found on the base form.

Has anyone ever had this problem before, and how was it solved?

1
You probably should be looking into UserControlsDirk Vollmar
Are you adding these other controls at design time or runtime to the derived forms?Tim Lentine
I added those other controls at design time.user727395
Are you hiding some of the parent form elements with the "new" keyword?Fernando
No. The base form only has a very few controls, one of which I need to make invisible in some of the derived forms (by setting its Visible property to "false", I guess.) I don't hide any of them with the "new" keyword.user727395

1 Answers

2
votes

The issue was resolved by specifying which form appears first at runtime. This was done by naming the form in Program.cs, as follows:

Application.Run(new DerivedForm());

Previously, the name of the base form appeared in the parentheses above.