ToolboxItemContainer Class

Encapsulates a ToolboxItem.

Namespace: System.Drawing.Design
Assembly: System.Drawing.Design (in

public class ToolboxItemContainer : ISerializable
/** @attribute SerializableAttribute() */ 
public class ToolboxItemContainer implements ISerializable
public class ToolboxItemContainer implements ISerializable
Not applicable.

ToolboxItemContainer is a simple class that encapsulates a ToolboxItem for efficiency. By having a single class that is always loaded, you can defer the loading of the ToolboxItem until it is needed. Because new classes can be derived from ToolboxItem, you could load a ToolboxItem that could, in turn, load an assembly that is not already in memory. For a large collection of ToolboxItem objects, this could cause a large number of assemblies to be loaded, which decreases performance. Instead, the toolbox service deals only with ToolboxItemContainer objects and retrieves their contained ToolboxItem only when necessary.

The ToolboxItemContainer is designed to hold any cached data from the ToolboxItem. The default implementation only holds the filter of the ToolboxItem, but deriving classes may choose to cache the name, image, and other information. ToolboxItemContainer objects support two forms of serialization: they can be serialized through standard runtime serialization, and they can also load and save themselves from a System.Windows.Forms.IDataObject. The former provides a very easy way to save ToolboxItemContainer objects to a persistent storage. The latter provides a way to integrate ToolboxItemContainer objects with mixed data storage formats.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions