Syncfusion.Diagram.Windows
Members 


Diagram Class

Interactive two-dimensional graphics control for diagramming, technical drawing, visualization, simulation, and technical drawing applications.
Object Model
Diagram ClassIMouseController InterfaceBinding ClassDiagramController ClassDiagramDocument ClassDoubleBufferSurface ClassViewerEventSink ClassFocusManager ClassRuler ClassScrollBarWrapper ClassLayoutManager ClassMetroColorTable ClassModel ClassMouseControllerDispatcher ClassMetroColorTable ClassMetroColorTable ClassMetroColorTable ClassMetroColorTable ClassScrollTipWindow ClassDiagramVisualStyle ClassRuler ClassView ClassScrollBarWrapper Class
Syntax
'Declaration
 
<DescriptionAttribute("Interactive 2D graphics and diagramming.")>
<DesignerAttribute(Syncfusion.Windows.Forms.Diagram.Controls.DiagramDesigner)>
<ToolboxItemAttribute(True)>
<ToolboxBitmapAttribute(Syncfusion.Windows.Forms.Diagram.Controls.Diagram, "ToolboxIcons.Diagram.bmp")>
<DefaultPropertyAttribute("Text")>
<DefaultEventAttribute("Click")>
<DesignerSerializerAttribute("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>
<ToolboxItemFilterAttribute("System.Windows.Forms")>
<DesignerCategoryAttribute("Component")>
Public Class Diagram 
   Inherits Syncfusion.Windows.Forms.ScrollControl
   Implements Syncfusion.Drawing.INonClientPaintingSupport, Syncfusion.Windows.Forms.Diagram.IPropertyContainer, Syncfusion.Windows.Forms.Diagram.IPropertyObserver, Syncfusion.Windows.Forms.Diagram.IServiceReferenceProvider, Syncfusion.Windows.Forms.Diagram.IViewer, Syncfusion.Windows.Forms.ICancelModeProvider, Syncfusion.Windows.Forms.IQueryFocusInside, Syncfusion.Windows.Forms.IScrollBarWrapperContainer, Syncfusion.Windows.Forms.ISplitterPaneSupport, Syncfusion.Windows.Forms.ISupportIntelliMouse, Syncfusion.Windows.Forms.ISupportUpdating, Syncfusion.Windows.Forms.IVisualStyle, Syncfusion.WinForms.Theme.IThemeProvider 
'Usage
 
Dim instance As Diagram
[Description("Interactive 2D graphics and diagramming.")]
[Designer(Syncfusion.Windows.Forms.Diagram.Controls.DiagramDesigner)]
[ToolboxItem(true)]
[ToolboxBitmap(Syncfusion.Windows.Forms.Diagram.Controls.Diagram, "ToolboxIcons.Diagram.bmp")]
[DefaultProperty("Text")]
[DefaultEvent("Click")]
[DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[ToolboxItemFilter("System.Windows.Forms")]
[DesignerCategory("Component")]
public class Diagram : Syncfusion.Windows.Forms.ScrollControl, Syncfusion.Drawing.INonClientPaintingSupport, Syncfusion.Windows.Forms.Diagram.IPropertyContainer, Syncfusion.Windows.Forms.Diagram.IPropertyObserver, Syncfusion.Windows.Forms.Diagram.IServiceReferenceProvider, Syncfusion.Windows.Forms.Diagram.IViewer, Syncfusion.Windows.Forms.ICancelModeProvider, Syncfusion.Windows.Forms.IQueryFocusInside, Syncfusion.Windows.Forms.IScrollBarWrapperContainer, Syncfusion.Windows.Forms.ISplitterPaneSupport, Syncfusion.Windows.Forms.ISupportIntelliMouse, Syncfusion.Windows.Forms.ISupportUpdating, Syncfusion.Windows.Forms.IVisualStyle, Syncfusion.WinForms.Theme.IThemeProvider  
Remarks

This control provides a surface for rendering and manipulating 2D shapes, symbols, text, and images. The user interface supports drag- and-drop, scaling, rotation, zooming, grouping, ungrouping, connection points, and many other features.

A diagram is composed of three objects: the Model, the View, and the Controller. The model-view-controller architecture provides a clear separation between data, visualization, and user interface. The model contains the data portion of the diagram, the view is responsible for rendering the diagram, and the controller handles user interaction. The model, view, and controller are accessible as properties in this control and can be manipulated directly.

Some of the methods and properties in this class are just wrappers that call identical methods in the model, view, or controller. For example, the following two lines of codes are equivalent: diagram.Undo(); // Same as diagram.Controller.Undo(); Methods that are simple wrappers are documented as such.

Graphical objects can be added to a diagram in several ways. One way is through drag-and-drop. Symbols can be dragged from a PaletteGroupView onto the diagram. Objects can also be added from the clipboard using the Paste method. Shapes can be drawn onto the diagram by activating one of several drawing tools such as the Syncfusion.Windows.Forms.Diagram.RectangleTool. Objects can also be created programmatically and added to the diagram by calling the Syncfusion.Windows.Forms.Diagram.Model.AppendChild method.

Activating user-interface tools is a task commonly performed by applications using this control. The ActivateTool method is used to activate tools. For example, the event handler for a toolbar button that draws a rectangle would look like this. private void drawRectangle_Click(object sender, System.EventArgs e) { this.Diagram.ActivateTool("RectangleTool"); }

Calling the Syncfusion.Windows.Forms.Diagram.HistoryManager.Undo method removes the command on the top of the undo stack and causes an undo to occur. The Syncfusion.Windows.Forms.Diagram.HistoryManager.Redo method will redo the last command that was removed from the undo stack. The UndoCommand and RedoCommand methods are usually called in response to clicking Undo and Redo on the Edit menu.

One advantage of the model-view-controller architecture is that the parts are interchangeable . Models, views, and controllers can be swapped in and out independently. For example, the user interface of the diagram can be completely replaced by swapping in a different controller implementation. To accomplish this, you must subclass this class and override one or more of the following methods: CreateModel, CreateView, CreateController.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            Syncfusion.Windows.Forms.Core.BaseControl
               Syncfusion.Windows.Forms.ScrollControl
                  Syncfusion.Windows.Forms.Diagram.Controls.Diagram

AssemblyVersion

Syncfusion.Diagram.Windows: 17.4460.0.46

See Also