inactive selected text background

SyntaxEditor for WPF Forum

Posted 3 years ago by Andrew Levine
Version: 19.1.0684
Avatar

I'm having some trouble getting the selection to keep showing when other controls have the focus. I tried setting the InactiveSelectedTextBackground property in XAML but it doesn't seem to do anything. The normal SelectedTextBackground property works though.

Comments (11)

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

Hi Andrew,

Sorry but I'm not seeing that, at least when trying in the latest version.  Setting that property, I see the selection change color to it when it's inactive.

Are you able to reproduce this in one of our samples?

[Modified 3 years ago]


Actipro Software Support

Posted 3 years ago by Andrew Levine
Avatar

Darn, in the Sample Browser for that version it works. OK, sorry for the mistake!

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

Hi Andrew,

Note that if you have an IHighlightingStyle registered in your highlighting style registry for DisplayItemClassificationTypes.InactiveSelectedText, that can also change the brush used.


Actipro Software Support

Posted 3 years ago by Andrew Levine
Avatar

I figured it out! there is actually a bug in my Actipro version that disables the inactive selected text color when IsMultiLine = False. Do you know if this still happens in the latest version? I've been reluctant to upgrade for this app because I got the look and feel just right with the earlier library.

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

Hi Andrew,

Aha... When in single-line mode, it tries to act like a normal TextBox that doesn't show the selection when unfocused.  Nothing has changed with that in the latest version since it is by design.


Actipro Software Support

Posted 3 years ago by Andrew Levine
Avatar

Oh no, will I have to make a custom highlighting style to mimic the inactive selected text in that case?

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

No, the inactive selected text brush, whether set via SyntaxEditor.InactiveSelectedTextBackground or via an IHighlightingStyle associated with the classification type DisplayItemClassificationTypes.InactiveSelectedText, will only display when SyntaxEditor is multi-line mode.  It is ignored in single-line mode, since SyntaxEditor doesn't render an inactive selection background in that mode.


Actipro Software Support

Answer - Posted 3 years ago by Andrew Levine
Avatar

Sorry, I meant a custom tagger that follows the current selection span and marks it with a brush that stays when the control is unfocused.

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

Yes, you could do that kind of thing if needed.


Actipro Software Support

Posted 3 years ago by Andrew Levine
Avatar
Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thanks for the suggestion, we'll make a note of it.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.