Back to Devexpress

DiagramOptionsBehavior.SelectedStencils Property

windowsforms-devexpress-dot-xtradiagram-dot-options-dot-diagramoptionsbehavior-95440dee.md

latest5.4 KB
Original Source

DiagramOptionsBehavior.SelectedStencils Property

Specifies the selected shape groups.

Namespace : DevExpress.XtraDiagram.Options

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
public virtual StencilCollection SelectedStencils { get; set; }
vb
Public Overridable Property SelectedStencils As StencilCollection

Property Value

TypeDescription
DevExpress.Diagram.Core.StencilCollection

A DevExpress.Diagram.Core.StencilCollection object.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to SelectedStencils
DiagramControl

.OptionsBehavior .SelectedStencils

|

Remarks

The Shapes panel displays available shape groups within the dropdown menu that is invoked by selecting the More Shapes item. End-users can select groups from the menu to display them within the panel. The selected groups are stored in the SelectedStencils collection.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedStencils property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-use-the-customdrawitem-event-to-draw-custom-icons-inside-diagram-items-t441104/CS/XtraDiagram.CustomDraw/Form1.cs#L29

csharp
DiagramToolboxRegistrator.RegisterStencil(stencil);
    diagramControl1.OptionsBehavior.SelectedStencils = StencilCollection.Parse("customShapes");
}

winforms-diagram-register-factoryitemtools-for-shapes/CS/WindowsFormsApp4/Form1.cs#L21

csharp
diagramControl1.OptionsBehavior.SelectedStencils = new StencilCollection() { "CustomStencil" };
}

winforms-diagram-create-custom-shapes-based-on-diagram-containers/CS/WindowsFormsApp4/Form1.cs#L26

csharp
diagramControl1.OptionsBehavior.SelectedStencils = new StencilCollection() { "CustomStencil" };
}

winforms-diagram-track-and-restrict-drag-actions/CS/WinApp7/Form1.cs#L13

csharp
diagramControl1.CreateRibbon();
diagramControl1.OptionsBehavior.SelectedStencils = new StencilCollection() { "BasicShapes" };

how-to-use-the-customdrawitem-event-to-draw-custom-icons-inside-diagram-items-t441104/VB/XtraDiagram.CustomDraw/Form1.vb#L26

vb
DiagramToolboxRegistrator.RegisterStencil(stencil)
    diagramControl1.OptionsBehavior.SelectedStencils = StencilCollection.Parse("customShapes")
End Sub

winforms-diagram-register-factoryitemtools-for-shapes/VB/WindowsFormsApp4/Form1.vb#L22

vb
DiagramToolboxRegistrator.RegisterStencil(stencil)
    diagramControl1.OptionsBehavior.SelectedStencils = New StencilCollection() From {"CustomStencil"}
End Sub

winforms-diagram-create-custom-shapes-based-on-diagram-containers/VB/WindowsFormsApp4/Form1.vb#L21

vb
DiagramToolboxRegistrator.RegisterStencil(stencil)
    diagramControl1.OptionsBehavior.SelectedStencils = New StencilCollection() From {"CustomStencil"}
End Sub

See Also

DiagramOptionsBehavior Class

DiagramOptionsBehavior Members

DevExpress.XtraDiagram.Options Namespace