Cannot Style ScintillaNet Text after or before syntax coloring

Topics: User Forum
Feb 23, 2011 at 5:46 PM
Edited Feb 23, 2011 at 5:46 PM
var scin = new Scintilla();
ScintillaHotspotStyle = scin.Styles.LastPredefined.Index + 1;
scin.Margins[0].Width = 20;
scin.Caret.HighlightCurrentLine = true;

scin.Styles[ScintillaHotspotStyle].IsHotspot = true;
scin.Styles[ScintillaHotspotStyle].Underline = true;
scin.Styles[ScintillaHotspotStyle].ForeColor = System.Drawing.Color.Blue;

var contents = File.ReadAllText(file);
scin.Text = contents;

//scin.ConfigurationManager.Language = "cpp";
//scin.ConfigurationManager.Configure();

scin.GetRange(2, 5).SetStyle(ScintillaHotspotStyle);

//scin.ConfigurationManager.Language = "cpp";
//scin.ConfigurationManager.Configure();

It doesn't matter which order of the commented lines, nor if the call to .Configure() is performed - the outcome is the same: http://i.imgur.com/n4kko.png

If however, I do not apply the syntax highlighting, it does work: http://i.imgur.com/OC3Xb.png

Scintilla is pretty confusing, so I'm probably doing something wrong - but I'm not sure what...