'Declaration Public Property Toolbox As IToolboxService
public IToolboxService Toolbox {get; set;}
'Declaration Public Property Toolbox As IToolboxService
public IToolboxService Toolbox {get; set;}
Note: Setting this property with a custom implementation of System.Drawing.Design.IToolboxService can significantly alter the behavior and capabilities of the report designer's toolbox. It should be done with understanding of the underlying mechanics and implications.
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); }