Creating an Editor Window
You can create an editor window using one of these methods:
Dropping from Visual Studio toolbar:
First insert the tern32.dll in the toolbar:
Right click on the 'Windows Form' category in the toolbox.
Select 'Customize Toolbox...".
Select the '.Net Framework Components'.
Click on the Browse button and select tern32.dll from the directory where you copied this dll.
Now you would see 'Tern' icon in the toolbar.
You can simply select this icon and drop it into your form.
You also need to set the License Key.
Namespace: The control methods are placed in the 'SubSystems.TE' namespace. The control constants are available in the 'tc' class. Example:
toc.TerSetFlags5(true,tc.TFLAG5_SET_FORM_TITLE);
By using the 'new' statement:
Here is an example:
using SubSystems.TE; // name space containg TE methods - C# syntax
Imports SubSystems.TE ' VBN syntax
TerSetLicenseKey("my-key"); // set your product License Key.
Tern toc = new Tern(); // Create a Tern object
Now set the initial creation properties before the control
handle is created:
toc.Location=new Point(0,0);
toc.Size=new Size(200,200);
toc.WordWrap=true; // Word wrap
toc.PageMode=true; // page mode
toc.PrintViewMode=true; // print-view mode
toc.FittedView=false; // fitted view mode
toc.ShowRuler=true; // show the horizontal ruler
toc.ShowVRuler=true; // show the vertical ruler
toc.ShowStatusBar=true; // show the status bar
toc.ShowToolBar=true; // show the toolbar
toc.VertScrollBar=true; // show vertical toolbar
toc.HorzScrollBar=true; // show the horizontal scroll bar
toc.BorderMargin=true; // create the border margin
toc.ReadOnlyMode=false; // read only
this.Menu=toc.BuildMenu(); // use the buit-in menu
toc.Parent=this;toc.Show(); // show the control
// An example of setting event handler
toc.Hypertext+=new Tern.EventHypertext(Hypertext); toc.MergeData+=new Tern.EventMergeData(MergeData);
// An example setting TE flags
toc.TerSetFlags5(true,tc.TFLAG5_SET_FORM_TITLE); // set form title
automatically when a new file is loaded in the editor// An example of reading an RTF file:
toc.ReadTerFile("my-file.rtf");