Inherited Layout Issues


So I have in my application a form that I use as a base form.

It has a panel docked to the top, inside which it has a panel docked to the top to hold the windows title and a panel set to fill to hold a window toolbar.
There are a few other sub panels and controls inside these 2 panels, labels, text boxes, buttons etc.

I then have another form that inherits from this.
In the designer I can see the inherited controls, but they don’t all appear. Worse still at runtime the top panel that holds the window title is not the correct size, it is somewhat shorter in the y plane.

If I modify things in the base class it seems erratic if it updates the inherited form at all or correctly. One example being where I deleted a panel in the base form, yet the inherited form still had a SetChildIndex call in the .designer.cs referencing it which I had to remove manually.

We are about to migrate a substantial application currently in Visual WebGUI to Wisej, and in order to maintain a consistent layout and style throughout I need to have base controls and forms that inherit their layouts correctly, and any changes made to the base forms ripple through properly.

Can you help at all with this ?
Is it something you are aware of and are improving ?


Andi Gordon

  • You must to post comments

Hi Andi,

I tried the Window1 -> Window2 with the panels docked in Window1 and it seems to work well. I suspect the issues you are seeing are related to the designer in visual studio. For the size problem at runtime would it be possible for you to send a small test case?

About the designer: we use the standard Visual Studio WinForms designer and all the behavior you see is the way it works with the WinForms designer (and WPF). When you delete a component from a base class Visual Studio cannot delete all the references to the deleted component in the derived classes. In general, when you update anything in a base class, the changes do not override the derived classes. The only change that sometimes Visual Studio can propagate is the name of the component.





  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.