<?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: Change Mouse Cursor on Tool in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439995#M11935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;this is in C#&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;override Tool Cursor method and&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return Cursors.Cross.Handle.ToInt32();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2011 19:07:23 GMT</pubDate>
    <dc:creator>DubravkoAntonic</dc:creator>
    <dc:date>2011-09-29T19:07:23Z</dc:date>
    <item>
      <title>Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439994#M11934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't seem to find exactly what I need here.&amp;nbsp; I am in VB .NET 2010 writing an Add In for ArcMap.&amp;nbsp; I have a tool that a user clicks then selects a polygon on the map view. After the tool is clicked, I would like to change the cursor to a crosshair.&amp;nbsp; Either the code I am using is wrong, or I am placing it in the wrong sub or function of the tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMouse As IMouseCursor = New MouseCursor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMouse.SetCursor(esriSystemMouseCursor.esriSystemMouseCursorCrosshair)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows.Forms.Cursor.Current = Cursors.Cross&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;both initiated from the OnActivate() sub.&amp;nbsp; Any help would be great.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 15:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439994#M11934</guid>
      <dc:creator>JeffreyLaird</dc:creator>
      <dc:date>2011-09-29T15:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439995#M11935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;this is in C#&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;override Tool Cursor method and&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return Cursors.Cross.Handle.ToInt32();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 19:07:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439995#M11935</guid>
      <dc:creator>DubravkoAntonic</dc:creator>
      <dc:date>2011-09-29T19:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439996#M11936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;this is in C#&lt;BR /&gt;override Tool Cursor method and&lt;BR /&gt;&lt;BR /&gt;return Cursors.Cross.Handle.ToInt32();&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you elaborate on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How does this work with an Inherits Addin?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Property CURSOR can not be declared 'overrides' because it does not override a property in a base class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 15:44:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439996#M11936</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2011-09-30T15:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439997#M11937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeffry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use custom Cursor of any sort using a TOOL addin rather than a button (if that is what you are using), and referencing the embedded .cur file within the config.esriaddinx xml file.&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;lt;Tool id="Microsoft_ArcMapAddin1_Jeffry_Class" class="Jeffry_Class" message="This is the description" caption="Jeffry" tip="Cursor Tooltip" category="AddInControls" image="Images\Jeffry_Class.png" cursor="Images\JeffryCustomCursor.cur"&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just remember to to have the build action of your cursor : AddInContent, rather than embedding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Within the Class referenced to in the xml file... you can then do a mousedown for example&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; 'OnMouse down
&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.OnMouseDown(arg)


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Code here on Mouse down

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is stated above is through ITool, through IToolDef, not Addin method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&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; 'for Cursor&amp;nbsp; - create the cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_Cursor = New System.Windows.Forms.Cursor(Me.GetType.Assembly.GetManifestResourceStream("FocusToolsToolbar.CrosshairCursor.cur"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not m_Cursor Is Nothing Then
&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; mh_Cursor = m_Cursor.Handle
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If


Public ReadOnly Property cursor() As Integer Implements ESRI.ArcGIS.SystemUI.ITool.Cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&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; Return mh_Cursor.ToInt32
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:41:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439997#M11937</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2021-12-11T19:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439998#M11938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had much better success using&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;OnActivate()
&amp;nbsp; System.Windows.Forms.Cursor.Current = Cursors.WaitCursor

&amp;nbsp;&amp;nbsp; 'do stuff
&amp;nbsp;&amp;nbsp;&amp;nbsp; My.ArcMap.Application.CurrentTool = Nothing
 End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:41:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439998#M11938</guid>
      <dc:creator>DavidWilton</dc:creator>
      <dc:date>2021-12-11T19:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439999#M11939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I had much better success using&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;OnActivate()
&amp;nbsp; System.Windows.Forms.Cursor.Current = Cursors.WaitCursor

&amp;nbsp;&amp;nbsp; 'do stuff
&amp;nbsp;&amp;nbsp;&amp;nbsp; My.ArcMap.Application.CurrentTool = Nothing
 End Sub&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is not correct, this is changing the windows cursor, meaning your cursor would change for all places on the screen regardless of location. Using what I had done, means the cursor changes ONLY when you are in the Map Window itself. Moving the cursor out of the map window to a toolbar changes back to the proper Pointer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/439999#M11939</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2021-12-11T19:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Change Mouse Cursor on Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/440000#M11940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can&amp;nbsp; you elaborate on how this can be implemented?&amp;nbsp; I am trying to change my tool cursor after click events, from one cursor to another, depending on the current click's function.&amp;nbsp; I am currently only able to set the cursor to default Window.Forms.Cursors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 21:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-mouse-cursor-on-tool/m-p/440000#M11940</guid>
      <dc:creator>WWalker</dc:creator>
      <dc:date>2017-02-27T21:45:59Z</dc:date>
    </item>
  </channel>
</rss>

