This topic has not yet been rated - Rate this topic

ToolboxService.CreateItemContainer Method (ToolboxItem, IDesignerHost)

Creates a new toolbox item container from a toolbox item.

Namespace:  System.Drawing.Design
Assembly:  System.Drawing.Design (in System.Drawing.Design.dll)
protected virtual ToolboxItemContainer CreateItemContainer(
	ToolboxItem item,
	IDesignerHost link


Type: System.Drawing.Design.ToolboxItem

The toolbox item for which to create an item container.

Type: System.ComponentModel.Design.IDesignerHost

An optional designer host that should be linked to this toolbox item. This parameter can be null.

Return Value

Type: System.Drawing.Design.ToolboxItemContainer
A new toolbox item container.

item is null.

The CreateItemContainer method gives you the opportunity to provide a derived version of a ToolboxItemContainer. By default, the ToolboxService class does not support linked items, so it returns null for link parameters that are not null. To provide link support, you should override this method to create a derived ToolboxItemContainer that is capable of handling links.

If the provided IDesignerHost link parameter is assigned, it indicates that this is a linked toolbox item.

Notes to Implementers

A linked toolbox item is one whose existence is tied to the storage of a particular designer host. So, in a typical project system, a designer host is associated with a particular file. A toolbox item linked to a designer host would automatically be deleted from the toolbox when the designer host’s source file is deleted or removed from the project.

Linked toolbox items make possible scenarios such as disabling the ASP.NET toolbox items when the Windows Forms designer is open.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.