-
Notifications
You must be signed in to change notification settings - Fork 2
/
Form1.vb
37 lines (33 loc) · 1.24 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports DevExpress.Diagram.Core
Imports DevExpress.Diagram.Core.Shapes
Imports System.Windows
Imports System.IO
Imports System.Reflection
Namespace XtraDiagram.CreateCustomShapes
Partial Public Class Form1
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
Public Sub New()
InitializeComponent()
RegisterCustomShapes()
Me.diagramControl1.SelectedStencils = New StencilCollection(New String() {"CustomShapes"})
End Sub
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
MyBase.OnLoad(e)
Me.diagramControl1.InitializeRibbon(Me.ribbonControl1)
End Sub
Private Sub RegisterCustomShapes()
Using stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomShapes.xml")
Dim stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, Function(shapeName) shapeName)
DiagramToolboxRegistrator.RegisterStencil(stencil)
End Using
End Sub
End Class
End Namespace