Not albe to add the controls as mentioned in the How To section


Author
Message
lopamudra vemulapalli
lopamudra vemulapalli
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 2, Visits: 10
Hello,

I am exploring the tool to use it in our development. I am trying out to see if I can add around 8 ports to rectangle and connect it to other rectangles after adding 8 ports using Diagram.
I tried to add controls using the following example:
http://support.nevron.com/KB/a8/create-a-simple-diagram-in-winform-application.aspx?KBSearchID=28419

but I was not able to add the controls nDrawingView and nDrawingDocument to a form. I am using Nevron Open Vision 2016.1 version.

Please help me resolve this.

Thanks

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,

The example you are looking at is for our old diagramming product - Nevron Diagram for .NET, but you are using the Diagram of Nevron Open Vision. That is why the code is not working. In order to get started with our new diagramming component - NOV Diagram, you should first initialize the NOV framework in the entry point of your applications (i.e. the "Program.cs" file of a C# WinForms application) as shown in the following documentation topic:

Hosting NOV in Windows Forms

Then you can either drag and drop a NOV drawing view from the toolbox to your form or you can programatically create it in you form's constructor or load event handler. Here's an example of the code to put in the form:


using System.Windows.Forms;
using Nevron.Nov.Diagram;
using Nevron.Nov.Diagram.Shapes;
using Nevron.Nov.UI;
using Nevron.Nov.Windows.Forms;

namespace NNovWinFormsSample
{
    public partial class frmDiagram : Form
    {
        public frmDiagram()
        {
            InitializeComponent();

            // Create a diagram UI (a drawing view with a ribbon)
            NWidget diagramUI = CreateDiagramUI();

            // Create a NOV widget host and place the diagram UI in it
            NNovWidgetHost<NWidget> novHost = new NNovWidgetHost<NWidget>(diagramUI);
            novHost.Dock = DockStyle.Fill;
            Controls.Add(novHost);
        }

        private NWidget CreateDiagramUI()
        {
            // Create a drawing view
            NDrawingView drawingView = new NDrawingView();
            NPage page = drawingView.Content.ActivePage;

            // Create and add a rectangle shape to the active page
            NBasicShapesFactory factory = new NBasicShapesFactory();
            NShape shape = factory.CreateShape(ENBasicShapes.Rectangle);
            shape.SetBounds(20, 20, 150, 100);
            page.Items.Add(shape);

            // Create a ribbon around the drawing view
            NDiagramRibbonBuilder builder = new NDiagramRibbonBuilder();
            return builder.CreateUI(drawingView);
        }
    }
}



Best Regards,
Nevron Support Team


lopamudra vemulapalli
lopamudra vemulapalli
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 2, Visits: 10
Hello,

Thanks for the reply. I was able to execute the program with given instructions. Can you also please let me know how can i add additional port on each side of rectangle (Center port is not required)?

Thanks,
Lopa
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
The following documentation topic gives more information about ports and demonstrates how to add ports to a shape:

NOV Diagram Ports

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search