Aug 17, 2010 at 10:45 AM
Edited Aug 17, 2010 at 1:58 PM
I'm getting a similar problem as described by rspyke.
I create the Scintilla control programatically, load in the text via ScintillaNet.Text = strMyFile
and then i set the ConfigurationManager.Language to "html".
At this point I'd expect that if I did a ScintillaNet.Update()
the control would now realise that it should colourise the control as per the "html" language I specified. Whether this should happen - I dont know but I'd expect at least that the
ScintillaNet.StyleChanged event be triggered.
This doesn't happen. What happens if that when I show the Form, to which the Scintilla component is a child using the Form.ShowDialog() method, the form shows and
then triggers the ScintillaNet.StyleChanged and updates the colour syntax.
What I'm trying to do(my end goal) is to determine if a word in the text is a comment or not: What I'd really like to do is load in the text, colourise it, and then search for a word and then see if that word is a comment. This should all happen before the
Form is shown. The only way I can see if a word (represented as a Scintialla.Range) is a comment is to ask scintilla via
string style = scintilla.Styles.GetStyleNameAt(rr.Start);
where rr represents the word that I'm querying to see if its styled as a comment. But because it seems that the style for the 'html' is not applied yet, the style variable always contains 'HTML.DEFAULT' but not 'HTML.COMMENT' which the word actually is.
I'm think there is a problem as rspkye suggested with "the style requires update message not being directed to the right windows message handler?"
let me know if i need to clarify(I've been looking at this for a day now so my wording/explanation could be very all-over-the-place (pretty much like my brain right now)) but hopefully you get what I'm trying to say :-)