Nevron Open Vision Documentation
Hosting NOV from the Visual Studio Toolbox

Most of the NOV widgets are exposed as toolbox items that allow you to directly place them inside a WinForms, WPF or Silverlight project. The toolbox items are installed in the Visual Studio Toolbox during the installation of NOV for Windows if you check the "Register in VS Toolbox" check box at install time. The following table lists the currently available toolbox items:

The following sections describe how to use these controls.

All NOV toolbox controls have a Widget property that exposes the widget embedded in the control (i.e. an instance of NButton, NRibbon, NRichTextView, NLinearGauge, etc.). The following code examples demonstrate how to use the Rich Text Text Editor toolbox item, but the code applies to other controls as well.

Steps to Integrate a NOV Control inside WinForms

1. Create a new Windows Forms Application project.

If you are using Visual Studio 2010 make sure that you target ".NET Framework 4.0" not ".NET Framework 4.0 Client Profile". 

2. Open Form1.cs in the designer.

3. From the toolbox select NNovRichTextViewControl and drop it to the form.

4. Double click on the form and insert the following code:

WinForms Example
Copy Code
using System;
using System.Windows.Forms;
using Nevron.Nov.Text;
namespace WindowsFormsApplication1
{
     public partial class Form1 : Form
     {
         public Form1()
         {
             InitializeComponent();
         }
         private void Form1_Load(object sender, EventArgs e)
         {
             NRichTextView richTextView = nRichTextViewControl1.Widget;
             NSection section = richTextView.Content.Sections[0];
             section.Blocks.Clear();
             section.Blocks.Add(new NParagraph("Hello Nevron Rich Text View"));
         }
     }
}

5. Run the application - it must display a rich text view control displaying "Hello Nevron Rich Text View".

Steps to Integrate a NOV Control inside Wpf

1. Create a new Wpf Application project.

If you are using Visual Studio 2010 make sure that you target ".NET Framework 4.0" not ".NET Framework 4.0 Client Profile". 

2. Open MainWindow.xamls.cs in the designer.

3. From the toolbox select NNovRichTextViewControl and drop it to the form.

4. Open the MainWindow.xamls.cs source file and insert the following code:

C#
Copy Code
using System.Windows;
using Nevron.Nov.Text;
namespace WpfApplication1
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            NRichTextView richTextView = nRichTextViewControl1.Widget;
            NSection section = richTextView.Content.Sections[0];
            section.Blocks.Clear();
            section.Blocks.Add(new NParagraph("Hello Nevron Rich Text View"));
        }
    }
}

5. Run the application - it must display a rich text view control displaying "Hello Nevron Rich Text View".

Steps to Integrate a NOV Control inside Silverlight

1. Create a new Silverlight Application project.

2. Open MainPage.xaml in the designer.

3. From the toolbox select NNovRichTextViewControl and drop it on the page.

4. Open the MainPage.xaml.cs file and insert the following code:

C#
Copy Code
using System.Windows.Controls;
using Nevron.Nov.Text;
namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            NRichTextView richTextView = nRichTextViewControl1.Widget;                 
            NSection section = richTextView.Content.Sections[0];
            section.Blocks.Clear();
            section.Blocks.Add(new NParagraph("Hello Nevron Rich Text View"));
        }
    }
}

5. Run the application - it must display a rich text view control displaying "Hello Nevron Rich Text View".

See Also
Send Feedback