First of all, my business is UWP applications.
TextBlockhas a property with a name SelectionHighlightColorthat allows you to specify a specific color Selection Areawhen choosing text. Similar:
XAML:
<TextBlock Text="This is a sample text" IsTextSelectionEnabled="True" SelectionHighlightColor="#FFFFE751" Foreground="Black" />
This is displayed as:

If you have not noticed, the foreground text of the selected text will always be White, even if the background of the selection area has a light color.
So, is there a way to change the foreground of the selected control text TextBlock?
source
share