[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [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]Gantt Control
  [Expand]Chart Control
    Getting Started
   [Collapse]Diagram Control
     Diagram Designer
     Shapes Panel
     Properties Panel
     Bottom Panel
     Page Setup Dialog Window
     Print Preview
     Creating Runtime Diagram Designer
     Pan and Zoom Panel
   [Expand]End-User Interaction
   [Expand]Diagram Items
   [Expand]Automatic Layout
   [Expand]Data Binding Functionality
    Themes and Styles
    Printing and Exporting
    Saving and Loading Diagrams
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [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]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Shapes Panel

The Shapes panel displays available Shapes that users can drag to the Canvas.

Users can click the Expand/Collapse buttons to toggle between full and compact modes. To change the display mode in code-behind, use the DiagramOptionsBehavior.ToolboxVisibility property. The image below shows the panel in compact mode.

Users can select the Shapes Panel item in the Ribbon UI to show or hide the Shapes panel.

Shapes are organized into categories. The Quick Shapes category contains shapes whose ShapeDescription.IsQuick property is set to true. Set the DiagramOptionsBehavior.ShowQuickShapes property to false to hide the Quick Shapes category.

The search form that is displayed at the top of the panel allows end-users to search a shape by its name. The dropdown button invokes the list of the most recently used (MRU) search strings.

Expanded Customization

Shapes in the Shapes panel are grouped by stencils. Use the DiagramOptionsBehavior.Stencils property to modify stencils for a specific DiagramControl (see DiagramControl). The following example shows how to create a stencil with an SVG shape:

To modify stencils for all diagrams in your application, use the DiagramToolboxRegistrator (see DiagramToolboxRegistrator) static class's DiagramToolboxRegistrator.RegisterStencil and DiagramToolboxRegistrator.UnregisterStencil methods. The example below illustrates how to remove all the default stencils from the Shapes panel.

Use FactoryItemTool to Add Items

The FactoryItemTool (see FactoryItemTool) class allows you to add the DiagramShape (see DiagramShape), DiagramImage (see DiagramImage), DiagramContainer (see DiagramContainer), and DiagramConnector (see DiagramConnector) items to stencils. The code snippet below illustrates how to add a new stencil with a raster image.

Modify Existing Items

Use the DiagramControl.ItemInitializing event to modify newly created diagram items and toolbox items. The example below illustrates how to change the border thickness for the Rectangle shape.

Remove Stencils

To remove a stencil from the Shapes panel, use the DiagramToolboxRegistrator (see DiagramToolboxRegistrator) static class's DiagramToolboxRegistrator.UnregisterStencil method:

To remove all stencils except those specified, initialize a new DiagramStencilCollection and set it as the DiagramOptionsBehavior.Stencils property value:

Remove Shapes From Stencils

Use the DiagramStencil.UnregisterShape method to remove a shape from a stencil. See the example below.

Create Hidden Stencils

Set the isVisible DiagramStencil (see DiagramStencil) constructor parameter to false to create hidden stencils. Hidden stencils are not shown in the Shapes panel, but their shapes can be used in the diagram. See the example below.

Expanded See Also

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