
I need to change current line dynamically and and set background color to that line.
How to do this one.
I need to change current line dynamically and and set background color to that line.
How to do this one.
Hi Ravi,
You would need to make a programmatic text change for the range of the line like this:
editor.Document.ReplaceText(TextChangeTypes.Custom, editor.Document.CurrentSnapshot.Lines[3].TextRange, "newtext");
For a line background color there are a couple ways to do that:
1) Make a classification tagger and put it over the line's range. The highlighting style associated with the classification type you assign should have a background. Some of the Adornments samples show that sort of thing.
2) Make a line-based indicator. This might be the best way to go. See samples and docs on indicators.
Please log in to a validated account to post comments.