How do I add a Diagram to a form?
Using the designer:
First, make sure you have added both the Syncfusion.Shared (namespace: Syncfusion.Windows.Forms) and Syncfusion.Diagram (namespace: Syncfusion.Windows.Forms.Diagram) controls to your tool box. You do this by right-clicking on your tool box and clicking all the components in these namespaces that you find listed under .NET Framework Components.
Once you have the Diagram components in your tool box, drag-and-drop the Diagram component onto your form. The model, view, and controller objects are available as properties under the MVC category in the Properties window.
From code:
[C#]
using Syncfusion.Drawing; using Syncfusion.Windows.Forms.Diagram; .... private Syncfusion.Windows.Forms.Diagram.Controls.Diagram diagram1; .... // minimal code to create a diagram on a form this.diagram1 = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram(); //add the Diagram control to the Form's control list this.Controls.Add(this.diagram1); |
[VB.NET]
Imports Syncfusion.Drawing Imports Syncfusion.Windows.Forms.Diagram .... Private diagram1 As Syncfusion.Windows.Forms.Diagram.Controls.Diagram .... ' minimal code to create a diagram on a form Me.diagram1 = New Syncfusion.Windows.Forms.Diagram.Controls.Diagram() 'add the Diagram control to the Form's control list Me.Controls.Add(Me.diagram1) |