Results 1 to 6 of 6

Thread: Inherited Form Problem

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Inherited Form Problem

    I have a base form with a toolstrip container and one toolstrip on it with five buttons.

    When I inherit from this form I can't see the toolstrip container, the toolstrip or the buttons. They appear during runtime, just not visible during design time (although they're visible in the document outline. The problem is that I can't add any toolstrips or buttons to the existing toolstrip on my inherited form.

    Does anyone know why this is happening and how I can fix it? It's making me wonder what the point of inherited forms are if you get problems like this...

    [EDIT] When I select the controls in the document outline window, the properties are grayed out and uneditable. I tried changing the modifiers of these controls on the base form from 'protected' to 'public' (and rebuilt the project) but still no joy.
    Last edited by simonm; Nov 6th, 2009 at 05:24 AM.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Inherited Form Problem

    The reason that they are invisible is probably because they are on a ToolStripPanel (the top panel of the container) which is hidden (collapsed).

    That said, you cannot edit any controls that are on the inherited base form anyway. You can only edit them in the base form, and those changes will then show up in all derived forms. That is just how inherited forms work.

    I do find that, in the case of Menu/Toolstrips, this is not optimal behavior. I would like it if you could still have the option of adding items to them. I am often in a situation where I need many forms with the same layout, but other toolstrip items. I do however have an Infragistics toolset which has a new toolstrip control which I'm pretty sure is editable in inherited forms. I'm not sure how they did that, lol.

  3. #3

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Inherited Form Problem

    What is the point of having a container in the base form if you can't add items to it in the inherited form?
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  4. #4
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Inherited Form Problem

    You need to add the items in the base form, so they must be the same in all inherited forms. At least, I have always thought that. Someone else may come along and tell us that that is not the case at all, but I'm pretty sure that I'm right

    I don't think it's very good either, but we've gotta live with it.

    Anyway, if it's just the one ToolStrip why not simply add it manually to all inherited forms? That would take half a second for each form.

  5. #5

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Inherited Form Problem

    I've got a toolstrip with five buttons on it, all code behind them is the same so implemented on the base form. I just need to add some additional buttons (sometimes) on an inherited form. Having to duplicate that on every form completely undermines the point of inheritance. You're supposed to be able to indicate (with the 'Modifiers' property) whether a control should be modifiable in the inherited form.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  6. #6
    New Member
    Join Date
    Dec 2010
    Posts
    1

    Re: Inherited Form Problem

    Last edited by mcaizcm3; Oct 3rd, 2011 at 07:14 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width