Provides methods and properties to manage and query the toolbox in the development environment.
Assembly: System.Drawing (in System.Drawing.dll)
The interface provides properties and methods for adding and removing toolbox items and toolbox creator callback delegates, serializing and deserializing toolbox items, and retrieving toolbox state information and managing toolbox state.
You can retrieve information about the contents of the toolbox with the following methods:
The CategoryNames property indicates the categories currently available on the toolbox.
The SelectedCategory property indicates the currently selected toolbox category.
The GetToolboxItems method retrieves the items on the toolbox, optionally filtered by a specified toolbox category.
You can add and remove toolbox items with the following methods:
You can refresh the toolbox, mark a toolbox item as used, or set the mouse cursor to a cursor that represents the current toolbox item using the following methods:
The Refresh method refreshes the toolbox display to reflect the current state of the toolbox items.
The SelectedToolboxItemUsed method signals the toolbox that the selected toolbox item has been used.
The SetCursor method sets the mouse cursor to a cursor that represents the current toolbox item.
You can use the toolbox to serialize or deserialize a toolbox item using the following methods:
The following code example demonstrates the use of the in design mode to list and select toolbox categories and items, and to create components or controls from toolbox items and add them to a Form. To use the example, compile the code to an assembly, and add a reference to the assembly in a Windows Forms application. If you are using Visual Studio, the IToolboxServiceControl is automatically added to the Toolbox. Create an instance of the IToolboxServiceControl on a form to test its behavior.
The following code example provides a component that uses the to add a "Text" data format handler, or ToolboxItemCreatorCallback, to the toolbox. The data creator callback delegate passes any text data pasted to the toolbox and dragged onto a form to a custom ToolboxItem that creates a TextBox containing the text.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.