Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Mouse busy icon

Tags:

icons

wpf

mouse

What's the best method in WPF for showing an Eggtimer/Busy mouse icon when opening a new window or retrieving records from a DB?

like image 786
Mitch Avatar asked Jul 27 '09 00:07

Mitch


People also ask

How do I change my cursor in WPF?

A switch statement filters on the cursor name and sets the Cursor property on the Border which is named DisplayArea. If the cursor change is set to "Entire Application", the OverrideCursor property is set to the Cursor property of the Border control. This forces the cursor to change for the whole application.

How do I change my cursor to hourglass in C#?

Hourglass Cursor [C#] If you want to change the mouse cursor at application level use static property Current of Cursor class. To show hourglass cursor assign value Cursors. WaitCursor. To return back the default behavior (to display control specific cursor) assign back value Cursors.

How do I change my cursor type?

To change how the mouse pointer looks , and then clicking Control Panel. In the search box, type mouse, and then click Mouse. Click the Pointers tab, and then do one of the following: To give all of your pointers a new look, click the Scheme drop-down list, and then click a new mouse pointer scheme.

What is cursor in C#?

A cursor in Windows is an icon that is displayed when you move a mouse, a pen, or a trackball. Usually, a different cursor image is displayed for different activity. For instance, the default cursor is different than a wait cursor. Cursors may be different for different operating systems.


1 Answers

The simplest way is to set Mouse.OverrideCursor:

Mouse.OverrideCursor = Cursors.Wait;
try
{
    // perform task
}
finally
{
    Mouse.OverrideCursor = null;
}
like image 141
Matt Hamilton Avatar answered Sep 28 '22 13:09

Matt Hamilton