The following guide is provided for users who wish to use the ScintillaNET control in their projects. This guide assumes the development platform is Visual Studio® 2010.
Table of Contents
Downloading and Unzipping
The ScintillaNET team regularly publishes new releases as features are added and bugs are fixed. These releases can easily be obtained from the ScintillaNET Downloads page on CodePlex. Files are distributed in both binary and source versions and then zip compressed.
- Download the binaries recommended release package from the
ScintillaNET Downloads page by clicking the appropriate link and selecting
I Agree from the license terms-of-use popup. (Other releases and versions maybe be available but we encourage you to download the "binaries" version of the recommended release unless you have a specific reason not to).
- Unzip the package using a third-party tool or by right-clicking on the file/icon in Windows Explorer and selecting
Extract All... from the context menu and following the wizard.
- Once unzipped you'll want to place the files in a location where they can easily be referenced by any of the projects you wish to use ScintillaNET with. For the purposes of this guide, we'll assume that the target directory is C:\ScintillaNET.
- If the previous steps were completed successfully you should have a folder on your computer with at least the files ScintillaNET.dll, SciLexer.dll, and SciLexer64.dll. Other license files and documentation may be included as well.
Configuring the Search Path
Failing to configure the search path or doing it incorrectly trips-up many users. ScintillaNET is a wrapper around an umanaged DLL and uses Platform Invoke (P-Invoke) calls from the managed ScintillaNET.dll to the native SciLexer.dll or SciLexer64.dll to perform
its magic. In order for that to work the SciLexer.dll and SciLexer64.dll must be in one of the places Windows uses to locate DLLs. More information about the
Search Path Used by Windows to Locate a DLL
can be found on the MSDN website. Of the many ways that Windows can use to find the SciLexer.dll and SciLexer64.dll, the instructions below illustrate
how to modify your PATH environmental variable.
- Right-click on the My Computer icon on the Desktop or in the Start Menu and select
Properties from the context menu.
- Select the Advanced tab.
- Click the Environment Variables button.
- Add the "C:\ScintillaNET" folder (assuming that is the location of the downloaded files, or substitute an alternate location) to the Path variable in the User Variables list.
- If there is no Path variable in the User Variables list, add one by clicking
New and inputing the value "Path" in the Variable Name field and "C:\ScintillaNET" in the Variable Value field.
- If there is already a Path variable in the User Variables list, select the Path variable and then click
Edit to modify. Append "C:\ScintillaNET" to the end of the Variable Value field separating it from any previous value(s) with a semicolon.
- Close all open Visual Studio or Visual C# applications and restart them for the changes to take effect.
Adding to the Visual Studio Toolbox
Adding the ScintillaNET control to the Visual Studio (or Visual C# Express Edition) toolbox makes adding it to one of your forms as easy as dragging and dropping.
- With the Windows Forms designer open in Visual Studio, right-click on the
ToolBox window and select Choose Items... from the context menu.
- From the Choose Toolbox Items dialog, select the .NET Framework Components tab and then click the
- Navigate to the location of the ScintillaNET.dll file on your system ("C:\ScintillaNET\ScintillaNET.dll" in our example) and after selecting the file, click the
- When the Open dialog closes, one or more ScintillaNET components will have been added to the list.
- Ensure that the entry named "Scintilla" is checked and then click the
- The Scintilla control should now be listed in the Toolbox. Simply drag it onto a form in the designer to begin using it.
Target the full .NET Framework
At the time ScintillaNET first start development there was no concept of targeting Client Profile versus full .NET Framework. Because of that ScintillaNET has dependencies that prevent it from running on the Client Profile (namely we depend on System.Design).
To target the full framework profile:
- Right-click on your startup project from the Visual Studio Solution Explorer and select
- From the Application tab of the project properties page change the Target framework field to
.NET Framework 4.
- ScintillaNET can also run on the 2.0, 3.0 and 3.5 versions of the framework.
- Save the changes to the project properties.