Select to view content in your preferred language

Set the mouse cursor to wait cursor

2181
4
Jump to solution
12-06-2019 05:17 AM
BarbaraSchneider2
Frequent Contributor

I would like to set the cursor to wait cursor. In ArcObjects, this works as follows:

IMouseCursor mouseCursor = new MouseCursorClass();

mouseCursor.SetCursor(2); // Wait cursor

When I use the wait cursor from System.Windows.Forms, it turns back to default cursor as soon as I move the mouse:

Cursor.Current = Cursors.WaitCursor;

Is there a good way to do this in ArcGIS Pro?

0 Kudos
1 Solution

Accepted Solutions
MatthewDriscoll
MVP Alum

Not sure if this would work for you, but perhaps you could put in a Progress Dialog.

var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel");
progDlg.Show();
var progSrc = new CancelableProgressorSource(progDlg);‍‍‍

View solution in original post

4 Replies
UmaHarano
Esri Regular Contributor

If you are developing a custom tool in Pro, here is a code snippet to modify the tool's cursor:

Change the cursor of a Tool

0 Kudos
BarbaraSchneider2
Frequent Contributor

Hello Uma,

thank you for your reply! I am not developing a custom tool. I run some calculations that last several seconds or minutes, and I want to show the user that she/he has to wait. With ArcObjects (using IMouseCursor), this worked perfect.

0 Kudos
MatthewDriscoll
MVP Alum

Not sure if this would work for you, but perhaps you could put in a Progress Dialog.

var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel");
progDlg.Show();
var progSrc = new CancelableProgressorSource(progDlg);‍‍‍
BarbaraSchneider2
Frequent Contributor

This is exactly what I am looking for.

0 Kudos