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 FormsThen 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