Syntax Highlighting

The easiest way to get syntax highlighting to work is to set the ConfigrationManager.Language property. The list of languages that have been fully configured for syntax highlighting are as follows

Language value Description
asm Assembly
cs c#
html HTML
js JavaScript
mssql Microsoft flavored T-SQL
psql Postgre SQL
python Python
vbscript VB Script
xml XML

You can also use any of Scintilla's built in lexer names, however your mileage will vary on these without a full configration specifying all the styles. However many of the lexers use the same styles so try it out and see which syntaxes get highlighted. Note that you'll need to supply keywords for most languages.
ada d lot props
apdl diff lout ps
asm eiffel lua purebasic
asn1 eiffelkw make python
au3 erlang matlab rebol
ave errorlist metapost ruby
baan escript mmixal scriptol
bash f77 mssql smalltalk
batch flagship nncrontab specman
blitsbasic forth nsis spice
bullant fortran null sql
caml freebasic octave tads3
clw gap opal tcl
clwnocase gui4cli pascal tex
cmake haskell perl vb
conf hypertext phpscript vbscript
cpp innosetup plm verilog
cppnocase kix pov vhdl
csound latext powerbasic xml
css lisp progress yaml

ConfigurationManager.Language can either be set in the designer or at runtime through code.

Last edited Mar 22, 2011 at 3:23 PM by blah38621, version 7


ChriEnengl May 31, 2016 at 12:46 PM 
same here - no ConfigurationManager!

maya8maya85 May 7, 2016 at 9:03 AM 
no ConfigurationManager.

telmessosc Sep 29, 2012 at 12:52 PM 
I read everything in here. But I still don't know how I can simply make PHP scripts colored. I have no idea about the usage of Lexer thing. Anyone can give me ideas?

kawish Jul 24, 2012 at 8:33 AM 
Hi, if I have a custom language syntax, let's say "MyLang" created by ANTLR. What should I do to make the syntax highlighting work? (I modified the SciLexer library to make it work at this moment)

silanliu Aug 4, 2011 at 4:40 AM 
Thanks I got it working now. But the colors it uses to highlight syntax for XML is so different from the main stream - what are used by Visual Studio or XmlSpy. Is there anyway to customize the colors?

ThinkWare Jul 27, 2011 at 9:58 AM 
You're right, I saw this and didn't know exactly how to implement it. I thought I'd have to create an instance of ConfigurationManager. Not only is this not necessary, it's not valid. But after only 2 minutes of trying I found the answer. For Example (yes, "example"!):
Your scintilla component is named "MyScintilla1", and you want to highlight HTML code, (Btw I'm using VB) Write:
MyScintilla1.ConfigurationManager.Language = "html"
And you're done, It works perfectly for me anyways

silanliu Jun 16, 2011 at 2:06 AM 
This is not called "example"! Where is the source code?