How can I change the forecolor of a line

SyntaxEditor for WPF Forum

Posted 8 years ago by Frank Link - CEO, FLK Consulting UG
Version: 16.1.0631


I would like to display a protokoll with different line colors.

How can I set the forecolor from a line with given linenr?

I have testet it with different Adorners but I can't find a solution.

Can you help me with a example?



Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Frank,

You'd need to apply a classification type tag over the line's range and have a highlighting style associated with that classification type.  One way you could do this is to use a custom indicator.  See the "Indicators - Custom" QuickStart for an example.  By altering the HighlightingStyle that is registered for the classification type, you could choose to just change the foreground color.  Also, methods like "editor.Document.IndicatorManager.Add" have overloads where you pass in an ITextSnapshotLine and the indicator will track one particular line.  You can get lines via editor.Document.CurrentSnapshot.Lines[lineno].

Actipro Software Support

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.