I've found a few things on setting CaretBrushes in WPF4, but has anybody actually ever changed the caret itself?
What I'd like to do is use the OVERWRITE caret in INSERT mode. I've seen a hack from .Net 3.5 times, but it is unperformant and lacks behind actual cursor movement...
It would be great if the Caret had a Template - That would be consistent with the whole WPF idea...
Any advice?
The CaretElement is an internal sealed class and not possible to customize through a data template for example. At least, the caret brush is possible to change.
<TextBox Text="This is some random text" CaretBrush="Blue" />
If you want to have a linear gradient on the caret brush, this can be done.
<TextBox Text="This is some random text" FontSize="20">
<TextBox.CaretBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="Blue" Offset="0" />
<GradientStop Color="Red" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</TextBox.CaretBrush>
I tried using a Visual Brush also, but the caret is always being shown as a small vertical line.