// Get a reference to the IDesignerHost IDesignerHost designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); // Get a reference to a specific control using its name Control control = designerHost.RootComponent.Controls["someControl"];
// Get a reference to the IDesignerHost IDesignerHost designerHost = (IDesignerHost)GetService(typeof(IDesignerHost)); // Get a reference to the ToolboxService IToolboxService toolboxService = (IToolboxService)designerHost.GetService(typeof(IToolboxService));This example shows how to use the GetService method to retrieve a reference to the ToolboxService in the designer environment. The ToolboxService is used to manage the set of controls and components that are available in the toolbox. Package Library: System.Drawing.Design