Hi,
I'm not sure if this is supported but I've been trying todo the following within VS2005:
- I have a custom component that has a custom root designer. To properly design this component, I need to host a new form designer within a portion of my component's designer. I need to track changes to the form to properly manage the state of my components. The embedded form won't be serialized.
I've had partial success by creating my own root designer and then placing a DesignSurface within part of my design window. I pass inmy component's designer host for the service provider for the design surface. It kind of works except that the PropertyGrid isn't tracking selection changes from within the embedded form designer, it tracksthe top-level designer changes even though I activate the embedded designer.
Here's a sample of my code that creates the embedded surface:
IDesignerHost designerHost = this.parentDesigner.DesignerHost;
IServiceProvider svcProv = (IServiceProvider)this.parentDesigner.DesignerHost;
DesignSurface embeddedDesignSurf = new DesignSurface(svcProv, typeof(Form));
embeddedDesignSurf.Initialize(); // CALLS IDesignerHost.Activate() for the embedded designer.
Control c = designSurf.View as Control;
c.Dock = DockStyle.Fill;
c.Parent = this; // a root designer's view control
Can anyone please help? Is this a proper way to do this and how can I make the property grid work? Is there a better way to do this?