NetRix Professional Editor

First Steps


The easiest way to start is using the VS.NET 2005 designer toolbox. If you want to use code for any reason, the minimum you need to use NetRix is covered in the following lines:

First, the recommended Namespaces we need:

using GuruComponents.Netrix;
using GuruComponents.Netrix.Events;

using GuruComponents.Netrix.WebEditing;
using GuruComponents.Netrix.WebEditing.Elements;

Imports GuruComponents.Netrix.NetRix
Imports GuruComponents.Netrix.Events
Imports GuruComponents.Netrix.WebEditing
Imports GuruComponents.Netrix.WebEditing.Elements

Then, the declaration and constructor call:

private GuruComponents.Netrix.HtmlEditor htmlEditor1;
this.htmlEditor1 = new GuruComponents.Netrix.HtmlEditor();

Friend htmlEditor1 As GuruComponents.Netrix.HtmlEditor
Me.htmlEditor1 = New GuruComponents.Netrix.HtmlEditor()

And a minimum of properties, which is recommended to set:

this.htmlEditor1.AllowDrop = true;
this.htmlEditor1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right);
this.htmlEditor1.AntiQuirks = false;
this.htmlEditor1.AtomicSelection = false;
this.htmlEditor1.AutoWordSelection = false;
this.htmlEditor1.BordersVisible = false;
this.htmlEditor1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.htmlEditor1.Location = new System.Drawing.Point(20, 15);
this.htmlEditor1.Name = "htmlEditor1";
this.htmlEditor1.Size = new System.Drawing.Size(619, 527);
this.htmlEditor1.Proxy = null;
this.htmlEditor1.TabIndex = 3;

Me.htmlEditor1.AllowDrop = true;
Me.htmlEditor1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right);
Me.htmlEditor1.AntiQuirks = false;
Me.htmlEditor1.AtomicSelection = false;
Me.htmlEditor1.AutoWordSelection = false;
Me.htmlEditor1.BordersVisible = false;
Me.htmlEditor1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
Me.htmlEditor1.Location = new System.Drawing.Point(20, 15);
Me.htmlEditor1.Name = "htmlEditor1";
Me.htmlEditor1.Size = new System.Drawing.Size(619, 527);
Me.htmlEditor1.Proxy = null;
Me.htmlEditor1.TabIndex = 3

And finally, dont forget to add the component to any container.

After this, just start editing. The DesignMode is enabled by default. If you want to use the component as a browser set DesignModeEnabled to false.

First Step

The most important thing is the ReadyStateComplete event. After loading any content the component starts internally an asynchronous load process. because you can load content from strings, files or web addresses, the load process will take some time. Some additional time is needed to render the document, depended on complexity of the document and power of the processor. To avoid stopping the host application the load process starts in a separate thread and the load method is left immediately. After finishing all internal processes the ReadyStateComplete event is fired.

Important: Any command MUST NOT be issued before the ReadyStateCompleteevent is fired. Otherwise the command fails or behaves unexpectedly.

The ReadyStateComplete event is the default event. To add the handler just double click the component in the VS.NET designer. Attaching the handler in code will look like this:

this.htmlEditor1.ReadyStateComplete += new System.EventHandler(this.htmlEditor1_ReadyStateComplete);

AddHandler Me.htmlEditor1.ReadyStateComplete, AddressOf Me.htmlEditor1_ReadyStateComplete

In this handler you are supposed to:

  • Activate each UI element (toolbars, menu items, ...)
  • Reset any dirty flags
  • Set statusbar panels
  • Loop through the DOM to add element specific event handlers

Last edited Dec 18, 2013 at 12:04 PM by joergisageek, version 1