dotnetmonitor.com |
|
|||||||||||
| The new DesignSurface class drastically
simplifies the code necessary to host a designer in your own application. The
following lines of code show the most simple designer that can be created.
Note: to run this code, a reference to System.Design.dll will need to be added.
DesignSurface surface = new DesignSurface(typeof(Form)); Control c = surface.View as Control; if (c != null) { c.Dock = DockStyle.Fill; this.Controls.Add(c); }
In any realistic application that selects, modifies and creates components, instance of IDesignerHost, ISelectionService, IComponentChangeService, and IToolboxService will be needed to interact with the hosted designer. |
|||||||||||