Adding ChromaCode to your project

NB: The download contains a demonstration project that illustrates how to use the control within your application

To use ChromaCode within your application simply follow these steps

Step 1
Add the ChromaCode.DLL as a reference to the project in which you would like to use the control. The control will only work in applications that have a user interface such as Windows Applications or UserControls.

Step 2
If the ChromaCode.DLL was added successfully then it should appear in the Toolbox and you can simply drag it on to surface that you want the control to appear on as you would any other control.

If you want to add it in the mark up then you need to add the following namespace reference to the Window or UserControl markup:

xmlns:my="clr-namespace:ChromaCode;assembly=ChromaCode"

Now you can simply place the following tag in any content control to make ChromaCode control usable:

<my:ChromaCode x:Name="syntaxHighlighter"/>

Step 3
At this point the control will act as a basic RichTextBox. In order to use it as a syntax highlighter control then you need to load an XML file that contains a set of rules on how to perform the highlighting. See the section on Properties and Methods and Creating a rule XML file for more information.

Last edited May 2, 2011 at 6:38 PM by NybbleUK, version 1

Comments

No comments yet.