Customizing the color of the ranges highlight in the completion list

SyntaxEditor for WPF Forum

Posted 8 years ago by Matt Whitfield
Version: 16.1.0630
Avatar

Hello

I'd like to be able to change the color that is used to highlight applicable ranges in the completion list - is that possible?

Thanks

Matt

Comments (5)

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

Hi Matt,

For most themes, the AssetResourceKeys.HyperlinkForegroundNormalBrushKey resource is used for highlighted ranges.  You can see in the Themes documentation how to override resources in your app's Resources.

The only time it changes is if that color is too close to the unhighlighted color in the current theme.  Then it uses an algorithm to make them a little different.


Actipro Software Support

Posted 8 years ago by Matt Whitfield
Avatar

I may be being stupid, but I actually can't see in the Themes documentation how you are supposed to over-ride an individual item. Perhaps it's there, but I've read through those pages a couple of times and can't see it.

I'd basically like to be able to set that color in code, if possible, because I need to apply it based on Visual Studio theme switching - and not all of the colors are available all of the time (for example, colors for the code window aren't defined if you're in the light theme - it appears to use a default set in that case).

Thanks

Matt

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

Hi Matt,

Check in the "Reusable Assets" topic in the Themes area.  The last section talks about it.  You could programmatically add/remove the override brush in the Application.Resources too.  It would have the same effect.


Actipro Software Support

Posted 8 years ago by Matt Whitfield
Avatar

Awesome, thanks :)

Posted 8 years ago by Matt Whitfield
Avatar

Ok, on further inspection, I think the logic for colors being 'close' might be a bit off. It's deciding that #FF569CD6 and #FFFFFFFF are too close, and picking a very light grey instead - which is practically invisible. Personally I don't think those two colors are close at all - and certainly think that if it does decide they are too close then the default behavior should not be to pick one that is closer...

I managed to work around that by using a LinearGradientBrush with both ends set to the same color - but thought it might be worth a look...

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.