Set Cursor Property for ArcGIS 10 Add-in Tool?

04-12-2011 08:28 AM
New Contributor II

I have been recycling code to VB.NET from VBA for use as an add-in with ArcMap 10. I got my tool working with a freshly built form, and there is no problem there. The only issue remaining is to change the cursor when the tool is activated. I tried using the namespace info for the Cursor property, but had no luck.

Here is my code, but it doesn't do anything. What have I missed?

    Protected WriteOnly Property Cursor()
        Set(ByVal value)
            value = ESRI.ArcGIS.SystemUI.esriSystemMouseCursor.esriSystemMouseCursorCrosshair
        End Set
    End Property

Thanks in advance!
0 Kudos
2 Replies
New Contributor
The code below is a simple tool that doesn't do anything. The cursor change seems to work fine.


Public Class Tool1
  Inherits ESRI.ArcGIS.Desktop.AddIns.Tool
    Public Sub New()

    End Sub
    Protected Overrides Sub OnActivate()
        Me.Cursor = Windows.Forms.Cursors.Cross
    End Sub
  Protected Overrides Sub OnUpdate()
    Enabled = My.ArcMap.Application IsNot Nothing
  End Sub
End Class
0 Kudos
New Contributor II
That worked perfectly, thank you.
0 Kudos