Set Cursor Property for ArcGIS 10 Add-in Tool?

3382
2
04-12-2011 08:28 AM
RobHalko
New Contributor II
Hello,

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.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Cursor_Property/001v0000...

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!
Rob
0 Kudos
2 Replies
BrianBottoms
New Contributor
The code below is a simple tool that doesn't do anything. The cursor change seems to work fine.

Brian

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
RobHalko
New Contributor II
That worked perfectly, thank you.
0 Kudos