Is it possible to change the Mouse Pointer (Cursor) when selecting a tool?

5065
2
Jump to solution
06-20-2018 09:06 AM
EvanMosher
New Contributor II

We find the standard tool mouse pointer, the crosshair, is hard to see for some of our users, we would like to be able to customize this mouse pointer when our custom tool is selected. Is this possible?

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi Evan,

You can set the "Cursor" property of your custom tool to change the standard cursor.  

 internal class CustomMapTool : MapTool
        {
            public CustomMapTool()
            {
                IsSketchTool = true;
                SketchType = SketchGeometryType.Rectangle;
                SketchOutputMode = SketchOutputMode.Map;
                //A custom cursor file as an embedded resource
                var cursorEmbeddedResource = new Cursor(new MemoryStream(MapExploration.Resource1.red_cursor));
                //A built in system cursor
                var systemCursor = System.Windows.Input.Cursors.ArrowCD;
                //Set the "CustomMapTool's" Cursor property to either one of the cursors defined above
                Cursor = cursorEmbeddedResource;
                //or
                Cursor = systemCursor;
            }
....‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

View solution in original post

2 Replies
UmaHarano
Esri Regular Contributor

Hi Evan,

You can set the "Cursor" property of your custom tool to change the standard cursor.  

 internal class CustomMapTool : MapTool
        {
            public CustomMapTool()
            {
                IsSketchTool = true;
                SketchType = SketchGeometryType.Rectangle;
                SketchOutputMode = SketchOutputMode.Map;
                //A custom cursor file as an embedded resource
                var cursorEmbeddedResource = new Cursor(new MemoryStream(MapExploration.Resource1.red_cursor));
                //A built in system cursor
                var systemCursor = System.Windows.Input.Cursors.ArrowCD;
                //Set the "CustomMapTool's" Cursor property to either one of the cursors defined above
                Cursor = cursorEmbeddedResource;
                //or
                Cursor = systemCursor;
            }
....‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
EvanMosher
New Contributor II

Perfect, just what i was looking for. Thanks alot Uma.

0 Kudos