Search
Step 9: Enable interactive drawing

To enable interactive drawing of IconNode objects, add the following code after the InitializeComponent call:

C#  Copy Code

// Let users draw IconNode objects
diagramView.CustomNodeType = typeof(IconNode);
diagramView.Behavior = Behavior.Custom;

Visual Basic  Copy Code

' Let users draw IconNode objects
diagramView.CustomNodeType = GetType(IconNode)
diagramView.Behavior = Behavior.Custom

Setting CustomNodeType and Behavior as shown above specifies that IconNode instances should be created when users draw on the diagram canvas.