[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Collapse]Diagrams
    Getting Started
   [Expand]Diagram Control
   [Expand]End-User Interaction
   [Expand]Diagram Items
   [Expand]Automatic Layout
   [Expand]Data Binding Functionality
    Themes and Styles
    Printing and Exporting
    Saving and Loading Diagrams
   [Collapse]Examples
     How to: Handle DiagramControl Events to Save Diagrams to a Database instead of a File System
     How to: Create Custom Shapes with Connection Points
     How to: Create Custom Shapes with Connection Points Using XAML
     How to: Use Custom Graph Layout Algorithms to Arrange Shapes in DiagramControl
     How to: Use the CustomDrawItem Event to Draw Custom Icons Inside Diagram Items
     How to: Create a DiagramShape Descendant and Serialize Its Properties
     How to: Create Custom Diagram Containers and Register them in the Toolbox and Ribbon Gallery
     How to: Change the Set of Shapes Available In the Shapes Panel
     How to: Customize Connection Points
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Change the Set of Shapes Available In the Shapes Panel

Shapes in the Shapes Panel are grouped into sets called stencils. Stencils are represented by the DiagramStencil class. The DiagramStencil.Shapes and DiagramStencil.ContainerShapes properties return the stencil's shapes and containers, and the DiagramStencil.IsVisible property indicates whether the stencil is available in the Shapes Panel.

To add a shape to a stencil, use the stencil's DiagramStencil.RegisterShape method.

The DiagramToolboxRegistrator class provides methods for modifying stencils. The DiagramToolboxRegistrator.Stencils property returns a list of stencils. To add or remove stencils from the list, use the DiagramToolboxRegistrator.RegisterStencil and DiagramToolboxRegistrator.UnregisterStencil methods. The code snippet below illustrates how to remove all the default stencils from the Shapes Panel.

To add custom diagram items to a stencil, use the DiagramStencil.RegisterTool method.

Note

The diagram control loads its stencils from the DiagramToolboxRegistrator.Stencils collection. You can use the DiagramOptionsBehavior.Stencils property if your application contains multiple diagram controls, and you want to specify individual sets of stencils for certain controls.

Is this topic helpful?​​​​​​​