Hello,
Could you, please, help me to make RadRichTextBox's caret visible?
I've tried to use solution with custom CaretFactory from this post... No results, unfortunately
Is it possible to make caret visible?
Here is some code examples of RadRichTextBox usage (my telerik version: 2018.3.911.45):
<
telerik:RadRichTextBox
x:Name
=
"descriptionRichBox"
Grid.Row
=
"0"
Grid.Column
=
"1"
Margin
=
"0,2,0,5"
MinHeight
=
"70"
BorderThickness
=
"{Binding IsReadOnly, Converter={localConverters:BoolToBorderThicknessConverter}}"
FontSize
=
"{Binding Source={StaticResource MediumNormal}, Path=Size}"
FontFamily
=
"{Binding Source={StaticResource MediumNormal}, Path=Family}"
IsReadOnly
=
"{Binding IsReadOnly}"
GotFocus
=
"RichTextBox_GotFocus"
DocumentInheritsDefaultStyleSettings
=
"True"
IsSpellCheckingEnabled
=
"False"
/>
<
telerik:HtmlDataProvider
RichTextBox
=
"{Binding ElementName=descriptionRichBox}"
Html
=
"{Binding EditableObject.Description, Mode=TwoWay}"
/>
<
Style
TargetType
=
"telerik:Caret"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:Caret"
>
<
Grid
x:Name
=
"RootElement"
>
<
ScrollViewer
x:Name
=
"ContentElement"
BorderThickness
=
"0"
Padding
=
"0"
/>
<
Rectangle
x:Name
=
"Rectangle"
/>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Left"
/>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Top"
/>
<
Setter
Property
=
"AcceptsReturn"
Value
=
"True"
/>
<
Setter
Property
=
"CaretBrush"
Value
=
"Black"
/>
<
Setter
Property
=
"Padding"
Value
=
"0"
/>
<
Setter
Property
=
"Foreground"
Value
=
"Transparent"
/>
</
Style
>
public
class
DescriptionCaretFactory : ICaretFactory
{
public
Caret CreateCaret()
{
return
new
Caret { Width = 2, MinWidth = 2, Height=5,
IsBlinking =
true
, IsEnabled =
true
,
Visibility = System.Windows.Visibility.Visible,
ToolTip =
"test caret"
,
CaretBrush = System.Windows.Media.Brushes.Black, };
}
}
Best regards,
Ivan.