Toolbox Property (Designer)
Gets or Sets the IToolboxService for the Report Designer.
Property Value
An instance of
System.Drawing.Design.IToolboxService that provides access to the toolbox service used by the report designer.
This example illustrates how to add a Designer component and a Toolbox to a Windows Forms application, configuring the Toolbox as the Designer's toolbox. Demonstrates how to control the availability of toolbox items in the designer's toolbox. Then, configure the toolbox with the state provider to control the enabled items. This example shows how to remove a specific item from the toolbox. It demonstrates finding the item by its type name and then removing it.
class MyForm : Form
{
MyForm()
{
var designer = new Designer() { Dock = DockStyle.Fill };
var toolbox = new Toolbox { Dock = DockStyle.Right };
designer.Toolbox = toolbox;
Controls.Add(designer);
Controls.Add(toolbox);
}
}
// First, define a state provider by implementing the IToolboxUser interface. This example enables only the BandedListDesigner tool.
class ToolboxStateProvider : IToolboxUser
{
public bool GetToolSupported(ToolboxItem tool)
{
if (tool.TypeName == "GrapeCity.ActiveReports.Design.DdrDesigner.Designers.BandedList.BandedListDesigner")
return true;
return false;
}
public void ToolPicked(ToolboxItem tool) { }
}
toolbox.ConfigureToolboxItems(new ToolboxStateProvider());
private static void RemoveBandedListFromToolBox(Toolbox toolbox)
{
// Find the item to be removed by its type name.
var bandedList = toolbox.GetToolboxItems()
.OfType<ToolboxItem>()
.Single(items => items.TypeName.EndsWith("BandedListDesigner"));
// Remove the found banded list item from the toolbox.
toolbox.RemoveToolboxItem(items);
}