How to highlight block of xml background only

SyntaxEditor Web Languages Add-on for Windows Forms Forum

Posted 8 years ago by NorthGates - NorthGates Systems
Version: 12.1.0311

On Editor_Changed when there is no selection I collect the textrange of the current block of xml and change the background to a pale colour.

To accomplish this I use HighlightingStyleSpanIndicator but my problem is the nicely colored font of xml attributres are also changed.

//Control Init
_spanIndicatorBlockHighlightingStyle = new HighlightingStyle(_spanIndicatorBlockHighlightName, "res:Block Highlight Style", Color.Empty, SystemColors.Control);

// How can I only change the textrange background color without affecting forecolor?
void editor_SelectionChanged(object sender, SelectionEventArgs e)

    if (e.Selection.IsZeroLength)
        //highlight the block  
             new HighlightingStyleSpanIndicator("HSS", _spanIndicatorBlockHighlightingStyle), MyTextRange);

[Modified 8 years ago]

Comments (1)

Answer - Posted 8 years ago by NorthGates - NorthGates Systems

I tried to delete my post because it actually worked fine. Sorry!!

The latest build of this product (v21.1.0) was released 18 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.