<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to change the cursor of an  ITool in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8873#M214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So it is really not "change the cursor of an ITool" but create a new tool with a cursor. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hence I used the term custom tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jan 2012 20:43:21 GMT</pubDate>
    <dc:creator>sapnas</dc:creator>
    <dc:date>2012-01-18T20:43:21Z</dc:date>
    <item>
      <title>How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8866#M207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am making an application with ARCGIS, and some actions take a lot of time (for example, zooming with ControlsMapZoomInToolClass). I would like to change the cursor to another one that tells the user that the application is busy (something like a sandwatch, or whatever), but Cursor property seems to be read only.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to change the Cursor when the action begins, and revert it when it ends?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 12:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8866#M207</guid>
      <dc:creator>SergioMunoz</dc:creator>
      <dc:date>2012-01-18T12:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8867#M208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In some of the .Net applications I build, I use the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;at the beginning of a long operation and at the end of the operation, setting it to the default with the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 13:25:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8867#M208</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2012-01-18T13:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8868#M209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In some of the .Net applications I build, I use the line&lt;BR /&gt;&lt;BR /&gt;System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor&lt;BR /&gt;&lt;BR /&gt;at the beginning of a long operation and at the end of the operation, setting it to the default with the line&lt;BR /&gt;&lt;BR /&gt; System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have done that too, but the problem is that the tool is inside a map, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICommand pCommand = new ControlsMapZoomInToolClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; pCommand.OnCreate(map.Object);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.CurrentTool = pCommand as ITool;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;STRONG&gt;map&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt; is an AxMapControl, and when the user moves the cursor into the map, it automatically changes the WaitCursor for the ControlsMapZoomInToolClass'. So what I want to do is to change the ControlsMapZoomInToolClass' cursor&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:22:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8868#M209</guid>
      <dc:creator>SergioMunoz</dc:creator>
      <dc:date>2021-12-10T20:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8869#M210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can create custom zoomin tool that inherits from itool and customize the cursor. Replace ControlsMapZoomInToolClass with custom zoom in tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
using System;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.ADF.CATIDs;
using System.Runtime.InteropServices;
namespace PanZoom
{
 [ClassInterface(ClassInterfaceType.None)]
 [Guid("2C214724-BFA2-4e8c-BC5D-775C67FA6F51")]
 public class ZoomIn : ICommand, ITool
 {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #region COM Registration Function(s)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ComRegisterFunction()]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ComVisible(false)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void RegisterFunction(Type registerType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Required for ArcGIS Component Category Registrar support
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISCategoryRegistration(registerType);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: Add any COM registration code here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ComUnregisterFunction()]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ComVisible(false)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void UnregisterFunction(Type registerType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Required for ArcGIS Component Category Registrar support
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISCategoryUnregistration(registerType);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: Add any COM unregistration code here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #region ArcGIS Component Category Registrar generated code
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Required method for ArcGIS Component Category registration -
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Do not modify the contents of this method with the code editor.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void ArcGISCategoryRegistration(Type registerType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ControlsCommands.Register(regKey);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Required method for ArcGIS Component Category unregistration -
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Do not modify the contents of this method with the code editor.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void ArcGISCategoryUnregistration(Type registerType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ControlsCommands.Unregister(regKey);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion
&amp;nbsp; [DllImport("gdi32.dll")]
&amp;nbsp; static extern bool DeleteObject(IntPtr hObject);
&amp;nbsp; private System.Drawing.Bitmap m_bitmap;
&amp;nbsp; private IntPtr m_hBitmap;
&amp;nbsp; private IHookHelper m_pHookHelper;
&amp;nbsp; private INewEnvelopeFeedback m_feedBack;
&amp;nbsp; private IPoint m_point;
&amp;nbsp; private Boolean m_isMouseDown;
&amp;nbsp; private System.Windows.Forms.Cursor m_zoomInCur;
&amp;nbsp; private System.Windows.Forms.Cursor m_moveZoomInCur;
&amp;nbsp; public ZoomIn()
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; //Load resources
&amp;nbsp;&amp;nbsp; string[] res = GetType().Assembly.GetManifestResourceNames();
&amp;nbsp;&amp;nbsp; if(res.GetLength(0) &amp;gt; 0)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream(GetType(), "ZoomIn.bmp"));
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(m_bitmap != null)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_bitmap.MakeTransparent(m_bitmap.GetPixel(1,1));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_hBitmap = m_bitmap.GetHbitmap();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; m_pHookHelper = new HookHelperClass ();
&amp;nbsp; }
 
&amp;nbsp; ~ZoomIn()
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if(m_hBitmap.ToInt32() != 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; DeleteObject(m_hBitmap);
&amp;nbsp; }
&amp;nbsp; #region ICommand Members
&amp;nbsp; public void OnClick()
&amp;nbsp; {
&amp;nbsp; }
&amp;nbsp; public string Message
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "zooms the Display In By Rectangle or Single Click";
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public int Bitmap
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return m_hBitmap.ToInt32();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public void OnCreate(object hook)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; m_pHookHelper.Hook = hook;
&amp;nbsp;&amp;nbsp; m_zoomInCur = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream(GetType(), "ZoomIn.cur"));
&amp;nbsp;&amp;nbsp; m_moveZoomInCur = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream(GetType(), "MoveZoomIn.cur"));
&amp;nbsp; }
&amp;nbsp; public string Caption
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Zoom In";
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public string Tooltip
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Zoom In";
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public int HelpContextID
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO:&amp;nbsp; Add ZoomIn.HelpContextID getter implementation
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public string Name
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Sample_Pan/Zoom_Zoom In";
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public bool Checked
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public bool Enabled
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(m_pHookHelper.FocusMap == null) return false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public string HelpFile
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO:&amp;nbsp; Add ZoomIn.HelpFile getter implementation
&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public string Category
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Sample_Pan/Zoom";
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; #endregion
 
&amp;nbsp; #region ITool Members
&amp;nbsp; public void OnMouseDown(int button, int shift, int x, int y)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if(m_pHookHelper.ActiveView == null) return;
&amp;nbsp;&amp;nbsp; //If the active view is a page layout
&amp;nbsp;&amp;nbsp; if(m_pHookHelper.ActiveView is IPageLayout)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create a point in map coordinates
&amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint pPoint = (IPoint) m_pHookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y);
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Get the map if the point is within a data frame
&amp;nbsp;&amp;nbsp;&amp;nbsp; IMap pMap = m_pHookHelper.ActiveView.HitTestMap(pPoint);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(pMap == null) return;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Set the map to be the page layout's focus map
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(pMap != m_pHookHelper.FocusMap)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pHookHelper.ActiveView.FocusMap = pMap;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pHookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; //Create a point in map coordinates
&amp;nbsp;&amp;nbsp; IActiveView pActiveView = (IActiveView) m_pHookHelper.FocusMap;
&amp;nbsp;&amp;nbsp; m_point = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y);
&amp;nbsp;&amp;nbsp; m_isMouseDown = true;
&amp;nbsp; }
&amp;nbsp; public void OnMouseMove(int button, int shift, int x, int y)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if(!m_isMouseDown) return;
&amp;nbsp;&amp;nbsp; //Get the focus map
&amp;nbsp;&amp;nbsp; IActiveView pActiveView = (IActiveView) m_pHookHelper.FocusMap;
&amp;nbsp;&amp;nbsp; //Start an envelope feedback
&amp;nbsp;&amp;nbsp; if(m_feedBack == null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_feedBack = new NewEnvelopeFeedbackClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_feedBack.Display = pActiveView.ScreenDisplay;
&amp;nbsp;&amp;nbsp;&amp;nbsp; m_feedBack.Start(m_point);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; //Move the envelope feedback
&amp;nbsp;&amp;nbsp; m_feedBack.MoveTo(pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y));
&amp;nbsp; }
&amp;nbsp; public void OnMouseUp(int button, int shift, int x, int y)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if(!m_isMouseDown) return;
&amp;nbsp;&amp;nbsp; //Get the focus map
&amp;nbsp;&amp;nbsp; IActiveView pActiveView = (IActiveView) m_pHookHelper.FocusMap;
&amp;nbsp;&amp;nbsp; //If an envelope has not been tracked
&amp;nbsp;&amp;nbsp; IEnvelope pEnvelope;
&amp;nbsp;&amp;nbsp; if(m_feedBack == null)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Zoom in from mouse click
&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnvelope = pActiveView.Extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnvelope.Expand(0.5, 0.5, true);
&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnvelope.CenterAt(m_point);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Stop the envelope feedback
&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnvelope = m_feedBack.Stop();
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Exit if the envelope height or width is 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(pEnvelope.Width ==0 || pEnvelope.Height == 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_feedBack = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_isMouseDown = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; //Set the new extent
&amp;nbsp;&amp;nbsp; pActiveView.Extent = pEnvelope;
&amp;nbsp;&amp;nbsp; //Refresh the active view
&amp;nbsp;&amp;nbsp; pActiveView.Refresh();
&amp;nbsp;&amp;nbsp; m_feedBack = null;
&amp;nbsp;&amp;nbsp; m_isMouseDown = false;
&amp;nbsp; }
&amp;nbsp; public void OnKeyDown(int keyCode, int shift)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if(m_isMouseDown)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(keyCode == 27)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_isMouseDown = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_feedBack = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_pHookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; public void OnKeyUp(int keyCode, int shift)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; // TODO:&amp;nbsp; Add ZoomIn.OnKeyUp implementation
&amp;nbsp; }
&amp;nbsp; public int Cursor
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; get
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(m_isMouseDown)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return m_moveZoomInCur.Handle.ToInt32();
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return m_zoomInCur.Handle.ToInt32();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; public bool OnContextMenu(int x, int y)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; // TODO:&amp;nbsp; Add ZoomIn.OnContextMenu implementation
&amp;nbsp;&amp;nbsp; return false;
&amp;nbsp; }
&amp;nbsp; public bool Deactivate()
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp; }
&amp;nbsp; public void Refresh(int hdc)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; // TODO:&amp;nbsp; Add ZoomIn.Refresh implementation
&amp;nbsp; }
&amp;nbsp; public void OnDblClick()
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; // TODO:&amp;nbsp; Add ZoomIn.OnDblClick implementation
&amp;nbsp; }
&amp;nbsp; #endregion
 }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:22:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8869#M210</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2021-12-10T20:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8870#M211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can create custom zoomin tool that inherits from itool and customize the cursor. Replace ControlsMapZoomInToolClass with custom zoom in tool.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Isn't this just a re-write of that functionality? There's no way to change properties for the existing control?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 17:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8870#M211</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-01-18T17:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8871#M212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;not that I know of&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 17:53:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8871#M212</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2012-01-18T17:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8872#M213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;not that I know of&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So it is really not "change the cursor of an ITool" but create a new tool with a cursor.&amp;nbsp; Does anyone know how you can actually do the first task? Is it even possible? How can you replace the bitmap used on the toolbar for an existing tool? (If you have to re-write the tool then that kind defeats the purpose of even having those tools available for use.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 20:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8872#M213</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-01-18T20:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8873#M214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So it is really not "change the cursor of an ITool" but create a new tool with a cursor. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hence I used the term custom tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 20:43:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8873#M214</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2012-01-18T20:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8874#M215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; (If you have to re-write the tool then that kind defeats the purpose of even having those tools available for use.)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;It�??s not like I�??m&amp;nbsp; imposing any one here to use the solution. If you don�??t like it don�??t implement it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 21:10:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8874#M215</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2012-01-18T21:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8875#M216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It�??s not like I�??m&amp;nbsp; imposing any one here to use the solution. If you don�??t like it don�??t implement it.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My intent was NOT to insult you!&amp;nbsp; You shared valuable knowledge and for that I thank you. I just wish ESRI would address this problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 21:31:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8875#M216</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-01-18T21:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8876#M217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can create custom zoomin tool that inherits from itool and customize the cursor. Replace ControlsMapZoomInToolClass with custom zoom in tool.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your reply, I already thought that solution, but ZoomIn is not the only tool I am using, and I don't want to replace all the tools I am using just because I want to change the icon. I cannot understand why the Cursor property is read only...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 14:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8876#M217</guid>
      <dc:creator>SergioMunoz</dc:creator>
      <dc:date>2012-01-19T14:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the cursor of an  ITool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8877#M218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you for your reply, I already thought that solution, but ZoomIn is not the only tool I am using, and I don't want to replace all the tools I am using just because I want to change the icon. I cannot understand why the Cursor property is read only...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, that part is obvious. Since it is hidden in the COM object that backs the command it would require someone to write code in the wrapper in order to expose that property and there may be issues with the way it is implemented that require more effort (and cost) to solve than that functionality is worth - to someone.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 16:29:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-change-the-cursor-of-an-nbsp-itool/m-p/8877#M218</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-01-19T16:29:23Z</dc:date>
    </item>
  </channel>
</rss>

