RadRichTextBox - Background color change when cursor is active.

0 Answers 8 Views
RichTextBox
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
Patrick asked on 15 May 2024, 04:06 PM
I am trying to customize the style of a RadRichTextBox. Previously with the standard RichTextBox you could target Textbox base and do a datatrigger to bind to IsKeyboard focused in XAML to change the background if the user had clicked inside the richtextbox to insert or type.

Does the RadRichTextBox have something similar? How can I check to see if it is selected?
Dimitar
Telerik team
commented on 16 May 2024, 01:42 PM

Hi Patrick,

Here is an example style for this: 

<Style TargetType="telerik:RadRichTextBox" BasedOn="{StaticResource RadRichTextBoxStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource Self}}" Value="True">
<Setter Property="Background" Value="blue"/>
</DataTrigger>
</Style.Triggers>
</Style>

Patrick
Top achievements
Rank 1
Iron
Iron
Iron
commented on 21 May 2024, 02:39 PM

IsKeyBoardFocusWithin is exactly what I was looking for, thank you!

No answers yet. Maybe you can help?

Tags
RichTextBox
Asked by
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or