简体   繁体   中英

How to display wait cursor when focusing on a RTB in WPF

So what is happening right now is the following. When I am focusing on a rich text box in my WPF application, I can't seem to change the cursor from a Carat (or what ever the 'I' text selection cursor is).

This is a problem, because when the user hits Ctrl+S, I want the program to save, and I want to display the Cursor.Wait cursor. This works if I am focusing on any other control (Treeview, stackPanel, Menu), everything except the RTB.

Is it just built this way with no way around it?

FrameworkElement.ForceCursor Property set to True will override the cursor preferences established by child elements:

<StackPanel ForceCursor="True" Cursor="Wait">
    <RichTextBox />
</StackPanel>

Now RichTextBox will show StackPanel cursor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM