How to set colors for all the different styler names during runtime?

Topics: User Forum
Mar 20, 2008 at 2:28 AM
Edited Mar 20, 2008 at 2:28 AM
I would like to start by thanking for an awesome component, you've really done a good job.

I have a question about how to set the color during runtime for all the different styler names (the ones that are declared in default.xml)?? I've found that you can set the color for a few of them using the 'Styles' property, but not all of them. Is there for example possible to set the color for the style name 'KEYWORD' and how where do I find that property (a one-line example would be really nice)??
One last question, I haven't found the property to set the color for the text marker (don't know what it's called in english), which shows where you're about to add text in the editor?? I've been able to set the backgroundcolor to black, but I haven't found the property for setting the color for the text marker. Since the text marker is black by default, I'm not able to see where I'm at.

/Jakob
Coordinator
Jul 25, 2008 at 3:00 PM
Edited Jul 25, 2008 at 3:01 PM
scintilla.Styles[scintilla.Lexing.StyleNameMap["Keyword"]].ForeColor = Color.Fuchsia;

I know it isn't very intuitive, and the style names themselves are all dependent upon the current lexer being used. So for instance the vblexer has a keyword style name, but the cpp lexer doesn't. However what would make things a lot easier would be to add a string overload of the Styles indexer that does the above in the background.
Coordinator
Jul 25, 2008 at 3:26 PM
Also question #2: What you're looking for is
scintilla.Caret.Color = Color.Red;