Visual Inheritance

Dears,

I created a base form containing few ToolStripButton and panels, but another (mdi)child form can't show all these controls after inheriting the base form. Is there any properties need to defined first, or Bring To Front (I can view it successfully in Designer Mode of VS2005, but not in runtime... :(

Thanks,


Answer this question

Visual Inheritance

  • SreenivasRao.K

    Yes, you're correct, I've marked both of your answer as "bingo" here. :)

    Thanks!

  • CJDuva

    One thing you need to take into account is that your derived class needs access to the fields in the base class in order to change the properties. So at design time in your base class you need look for the 'Modifiers' property and change it to 'Protected'. Do this for each control/component you want to allow changes to from a derived class.

    Phil Wright
    http://www.componentfactory.com
    Free user interface controls for .NET2

  • Albert Pascual

    Thanks Phil,

    I've changed the modifier from Private to Protected, but my child form still can't override it...

    For example, I have a panel on the base form, and then I can't drag any control (e.g. label) onto that panel in the child form under Designer Mode of VS2005. (but I can drop it to some other place on the child form).

    Thanks,

  • Matthew Weyer

    Try changing it from protected to public. Phil.
  • Jobby

    When you say Visual Inheritance,I guess you have created an inherited Form from the templates available in VS.net.In that case,as Philip says,changing the panel to protected should allow you to drag and drop controls onto the panel in the inherited form.
  • Visual Inheritance