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

How to Create Custom Shapes with Custom Connection Points for DiagramDesignerControl

  • 3 minutes to read

This example illustrates how to create custom shapes and add them to the DiagramDesignerControl.

The Diagram control supports a special language for defining shapes. The main element that contains shape description is ShapeTemplate. This element describes a shape contour and may contain several segments:

  • Start. Specifies the start point

  • Line. Defines a line with start and end points

  • Arc. Defines an arc with start and end points

To specify connection points, use the ShapeTemplate.ConnectionPoints property.

To register custom shapes, create a stencil with the DiagramStencil.Create method and pass it to the DiagramToolboxRegistrator.RegisterStencil method.

View Example

Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Windows

Namespace DXDiagram.CreateCustomShapes
    ''' <summary>
    ''' Interaction logic for App.xaml
    ''' </summary>
    Partial Public Class App
        Inherits Application

    End Class
End Namespace