views:

3

answers:

0

Quick Steps to reproduce problem:

  1. Create a new class, "TestUserControl", that derives from UserControl. Add a ContextMenuStrip from the VS ToolBox. Add the following property on the class...

    [System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    public ContextMenuStrip OwnContextMenuStrip
    {
        get { return contextMenuStrip1; }
        set { contextMenuStrip1 = value; }
    }
    
  2. Setup a new or existing Windows Application project to reference the new class we created above. Using the VS Designer, drag a new instance of "TestUserControl" onto the form, and add a couple MenuStripItems through the OwnContextMenuStrip.Items collection. Then copy/paste the first instance of "TestUserControl1" to create "TestUserControl2." Now here lies the problem: you will find that the MenuStripItems that you added to the original TestUserControl1.OwnContextMenuStrip HAVE BEEN MOVED to TestUserControl2.OwnContextMenuStrip and are NO LONGER PRESENT in the original TestUserControl1.OwnContextMenuStrip.

Any ideas on how this can be resolved? The original MenuStripItems should NOT be disassociated with the original control instance.

PS - I'm using VS2005 - .NET 2.0

Solutions anyone? MUCH THANKS in advance.