So anyways, I'm trying to implement custom syntax highlighting into a Scintilla control in Visual C#.NET.
I've been told do this through an XML file. I have named it "ScintillaNET.xml" and placed it in the debug bin for my project.
In the Form_Load, I set its language to batch (which is correct), and in the properties I specify the location of the file.
The code I have in the XML file is:
<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
<!-- Set up the language, style, and lexer for batch -->
<Language Name="batch">
<!-- Lexer -->
<Lexer StreamCommentPrefix="{ " StreamCommentSuffix=" }">
<Keywords List="0">var</Keywords>
</Lexer>
<!-- Style -->
<Styles>
<Sytle Name="CHARACTER" ForeColor="Black" BackColor="Red"/>
</Styles>
<!-- Other Settings -->
<Indentation TabWidth="2" UseTabs="false"/>
</Language>
</ScintillaNET>
Unfortunately, that doesn't seem to work... When I run my program, nothing happens in Scintilla.
My main goal for the custom syntax highlighting is nothing complicated.
I just want to be able to: Choose the words to be highlighted. Choose the color to have them highlighted/colored in.
How do I do this? What's wrong with my code?
(and if anyone has a quick tutorial on how to do it, that would be appreciated)
I've tested your xml file in my machine. A windows form app with ScintillaNet Control and with your xml is working fine.
Make sure you do following:
references:
(Installation) http://scintillanet.codeplex.com/wikipage?title=Installation&referringTitle=Documentation
(How do I use my own configuration files?) http://scintillanet.codeplex.com/wikipage?title=HowToCustomConfig&referringTitle=Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With