How can I set the Mouse cursor in XAML?
What's the use of Cursor property in every control? Please don't answer as Cursor="Arrow" cause this is not working.
Only way I can do it right now is from code behind by
Mouse.OverrideCursor. Can I do it simply using XAML?
I have a Hierarchy of controls where there is a GridSplitter in between somewhere. I'm trying to set the Cursor to SizeNS but it's set to default as default Arrow. What Should I do?
In WPF Cursor creates problem when controls are declared in hierarchy and properties get overwritten.
If you strictly want to set Cursor in a control use ForceCursor property of FrameworkElement class.
Syntax:
<StackPanel Name="CursorForced" ForceCursor="true" Cursor="Hand">
<Label>Cursors Forced</Label>
<TextBox>Fill me in!</TextBox>
</StackPanel>
In above example if I don't use
ForceCursortheCursorwill be different overTextBoxnot as I defined in parent control.
MSDN link to How to Force Cursor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With