Select to view content in your preferred language

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

5854
3
Jump to solution
06-20-2018 09:06 AM
EvanMosher
Occasional Contributor

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?

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

3 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
Occasional Contributor

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

0 Kudos
Jonathan_Goergen
Occasional Contributor

Is there a way to do this type of customization with built in tools? I would like to be able to change the cross hair cursor that appears when using linked views to, like the original poster, better see the cursor.

0 Kudos