Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DiagramShape Class

Displays a shape on the diagram canvas.

Namespace: DevExpress.XtraDiagram

Assembly: DevExpress.XtraDiagram.v24.2.dll

NuGet Package: DevExpress.Win.Diagram

#Declaration

public class DiagramShape :
    DiagramItem,
    IDiagramShape,
    IDiagramShapeBase,
    IDiagramItem

#Remarks

Use the following properties to initialize a shape’s main settings.

You can link two shapes with a DiagramConnector, using the DiagramConnector.BeginItem, DiagramConnector.EndItem, DiagramConnector.BeginItemPointIndex and DiagramConnector.EndItemPointIndex properties.

For more information on shapes, see the Diagram Items topic.

#Example

The following code assigns the DevExpress.Diagram.Core.BasicFlowchartShapes.Decision shape kind to a shape and specifies the shape text and size.

DiagramShape-Shape

diagramShape1.Shape = DevExpress.Diagram.Core.BasicFlowchartShapes.Decision;
diagramShape1.Content = "Initialized?";
diagramShape1.Size = new Size(150, 60);
See Also