See Also: IToolboxService Members
The System.Drawing.Design.IToolboxService 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 IToolboxService.CategoryNames property indicates the categories currently available on the toolbox.
The IToolboxService.SelectedCategory property indicates the currently selected toolbox category.
The IToolboxService.GetToolboxItems method retrieves the items on the toolbox, optionally filtered by a specified toolbox category.
The IToolboxService.GetSelectedToolboxItem method retrieves the currently selected System.Drawing.Design.ToolboxItem.
The IToolboxService.SetSelectedToolboxItem(ToolboxItem) method selects the specified System.Drawing.Design.ToolboxItem as the current toolbox item.
The IToolboxService.IsSupported(object, System.ComponentModel.Design.IDesignerHost) method indicates whether the specified serialized object, if it is a System.Drawing.Design.ToolboxItem, is supported by the specified designer host, or whether it matches the specified attributes.
The IToolboxService.IsToolboxItem(object) method indicates whether the specified serialized object is a System.Drawing.Design.ToolboxItem.
You can add and remove toolbox items with the following methods:
The IToolboxService.AddToolboxItem(ToolboxItem) method adds a System.Drawing.Design.ToolboxItem to the toolbox, creating the optionally specified category if it does not exist.
The IToolboxService.AddLinkedToolboxItem(ToolboxItem, System.ComponentModel.Design.IDesignerHost) method adds a System.Drawing.Design.ToolboxItem that is only enabled for the current project to the toolbox.
The IToolboxService.RemoveToolboxItem(ToolboxItem) method removes the specified System.Drawing.Design.ToolboxItem.
The IToolboxService.AddCreator(ToolboxItemCreatorCallback, string) method adds a System.Drawing.Design.ToolboxItemCreatorCallback delegate capable of converting some type of data stored on the toolbox to a System.Drawing.Design.ToolboxItem.
The IToolboxService.RemoveCreator(string) method removes any System.Drawing.Design.ToolboxItemCreatorCallback delegates for the specified data type.
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 IToolboxService.Refresh method refreshes the toolbox display to reflect the current state of the toolbox items.
The IToolboxService.SelectedToolboxItemUsed method signals the toolbox that the selected toolbox item has been used.
The IToolboxService.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 IToolboxService.DeserializeToolboxItem(object) method attempts to return a System.Drawing.Design.ToolboxItem from the specified serialized toolbox item object.
The IToolboxService.SerializeToolboxItem(ToolboxItem) method returns a serialized object representing the specified System.Drawing.Design.ToolboxItem.