How to highlight block of xml background only

SyntaxEditor Web Languages Add-on for Windows Forms Forum

Posted 11 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 11 years ago]

Comments (1)

Answer - Posted 11 years ago by NorthGates - NorthGates Systems

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

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

Add Comment

Please log in to a validated account to post comments.