Visual inheritance and layoutPanel problems

If I create a Form with a FlowLayoutPanel or GridLayoutPanel, then create a new Form inheriting from this base Form, the layout panels are locked (even if their modifiers are public or protected). I can add controls to the new form around the layout panels, but not within the layout panels.

Is there a way to fix/work around this Or does it basically defeat the purpose of visual inheritance and send me back to lots of copy/paste


Answer this question

Visual inheritance and layoutPanel problems

  • sinha37834

    I want to add controls to the layout panel, not to it's owner form. If I place a control on to the form and try to drag it into the panel the mouse cursor turns into a circle with a line through it (as in the operation is not allowed).

    The reason I want to use visual inheritance is to have a base form that defines the layout so the layout is consistent on all forms in the application. Is it even possible to use (as in modify the contents of) layout panels on inherited forms

    The steps to replicate my problem are as follows:

    1. Create a new project;
    2. Add a FlowLayoutPanel to the form and save the form;
    3. Add a new form that inherits from the first form;
    4. Try and add a button inside the FlowLayoutPanel.

    I cannot get step 4 to work.

    Thanks for your time


  • Katu

    You click on the Panel in design view. Then you hit the the escape key on you keyboard (esc) to unselect the current Panel and selects his owner. In the property window you can see wish control you have selected.

    Now if you selected the control you want you dubble-click on the item in the toolbox that you want to add. Now the item will be added.

    A other easy way to select and control is to use the combobox on top of the Property tab.


  • Visual inheritance and layoutPanel problems