If you are not creating a cross-platform application, the easiest way to create a rich text view with command bars is to use the Visual Studio designer and drop an NRichTextViewWithCommandBarsControl from the Visual Studio toolbox to your form/window. Check out the Rich Text Command Bars Designer topic for more information on how to use the Visual Studio designer to customize the rich text command bars.
Alternatively, you can use the NRichTextViewWithCommandBars class to add a rich text view with command bars to your form/window programmatically. The example below demonstrates how to create a rich text view with command bars hosted in a NOV widget host. You can then add this host to a form's Controls collection if you are creating a WinForms application, set it as the Content of a WPF window in a WPF application project, or to the ContentView of a Xamarin.Mac window.
Create a rich text view with command bars |
Copy Code
|
---|---|
NRichTextViewWithCommandBars commandBarsUI = new NRichTextViewWithCommandBars(); // Create a rich text view with command bars NRichTextView richTextView = ribbonUI.View; // Get the rich text view // Create a NOV widget host that hosts the rich text view with command bars NNovWidgetHost<NWidget> novHost = new NNovWidgetHost<NWidget>(commandBarsUI); |