Diagram for .NET / Getting Started / Integrating in Windows Forms / Components and Controls

In This Topic
    Components and Controls
    In This Topic

    When creating a WinForms application you typically drag components and controls from the Visual Studio Toolbox and drop them on the Form design surface. Nevron Diagram for .NET provides several ready to use controls, which will help you quickly and easily integrate diagramming capabilities in your WinForm application.

    VS 2010 users must switch the target framework to ".NET Framework 4" as by default Windows Forms applications target ".NET Framework 4 Client Profile". This is required, because Nevron Diagram for WinForms uses design time support features that are not present in ".NET Framework 4 Client Profile". To do this right click on the project in Solution Explorer and select properties. On the Application tab go to "Target Framework" and select ".NET Framework 4".
     Document Components and View Controls

    When integrating Nevron Diagram for .NET in your WinForm application, you must first create a document component. Nevron Diagram for .NET automatically installs two document components in Visual Studio Toolbox:

    Diagram Document Components
    Icon and Name Description Assembly
    NDrawingDocument The drawing document consists of shapes, which are organized in layers. Nevron.Diagram.dll
    NLibraryDocument The library document is a collection of masters. Each master contains one or more shapes. Nevron.Diagram.dll


    Components themselves do not have a visual representation and when dropped on the Form will only appear in the components tray. In order to display a document component in WinForms you need a view control. Nevron Diagram for .NET automatically installs two document view controls in the Visual Studio Toolbox:

    Diagram Document View Controls
    Icon and Name Description Assembly
    NDrawingView WinForm Control, which is used to display and edit a drawing document. Nevron.Diagram.WinForm.dll
    NLibraryView WinForm Control, which is used to display and edit a library document. Nevron.Diagram.WinForm.dll


    When dropped in the Form both document view controls will display a message that they are not connected to a document component. To connect a view control to a document component you must set the Document property of the view control to reference the respective document component. For example: the NDrawingView Document property must be set to a valid NDrawingDocument component, while the NLibraryView Document property must be set to a valid NLibraryDocument component.

    The Document property of a view control can also set at runtime. This gives you the ability to dynamically switch the documents displayed by a view control.

    See the My First WinForm Diagram topic for a step by step tutorial on how to create a drawing document, displayed by a drawing view.

     Pan and Zoom Control

    It is often required to display a bird's-eye view of the drawing document displayed by a drawing view. In Nevron Diagram for .NET this is achieved with the help of the pan and zoom control. When dropped on the form its MasterView property must be set to a valid NDrawingView control instance. Once connected to a master view it will help you interactively pan and zoom the master view.

    Icon and Name Description Assembly
    NPanAndZoomControl WinForm Control, which is used for the interactive zooming and panning of a drawing view Nevron.Diagram.WinForm.dll
     Property Browser

    The property browser is a control, which is used for the visual editing of the selection anchor, active layer, drawing document or drawing view properties. When dropped on the form its View property must be set to a valid NDrawingView control instance.

    Icon and Name Description Assembly
    NPropertyBrowser WinForm Control, which is can be used for the interactive editing of the document, active layer, selection anchor or view properties Nevron.Diagram.WinForm.dll
     Status Bar

    The status bar is a control, which can is used to display information about the current status of a drawing view. When dropped on the form its View property must be set to a valid NDrawingView control instance.

    Icon and Name Description Assembly
    NDiagramStatusBar WinForm Control, which displays important information about the current view state Nevron.Diagram.WinForm.dll
     Library Browser

    The library browser is an extended panel bar, which is used to display several library view - library document pairs, which are called library groups. It also provides an easy and intuitive set of operations to help you manage these library groups both from code and visually, with the help of commands. 

    Icon and Name Description Assembly
    NLibraryBrowser WinForm Control, which can be used for the interactive editing of multiple library document - library view pairs Nevron.Diagram.WinForm.dll
     Diagram Command Bars Manager

    The diagram command bars manager is a component, which hosts a diagram commander. The diagram commander maintains a set of predefined commands, which execute actions upon the other diagram controls and components. When dropped on the form you instruct the commander, which controls to command by setting the following properties:

    • View - when set to a valid NDrawingView control instance the commander will provide a set of commands related to the drawing view selection, loading and saving of the document displayed by the view, enabling/disabling tools etc.
    • LibraryBrowser - when set a valid NLibraryBrowser control instance, the commander will provide a set of commands related to the embedded library views items shapes (icons and details, icons only, thumbnails etc.). It will also provide a set of commands to manage the current set of library groups (new, open, save and close).
    • StatusBar - when set to a valid NDiagramStatusBar control instance, the commander will provide a command, which toggles the status bar visibility.
    • PropertyBrowser - when set to a valid NPropertyBrowser control instance, the commander will provide a command, which toggles the property browser visibility.
    Icon and Name Description Assembly
    NDiagramCommandBarsManager WinForm Component, which hosts the commands model of Nevron Diagram for WinForms Nevron.Diagram.WinForm.dll