1

I'm writing a add-in for ArcMap 10.5 in VB.NET. I've chosen the item "Button". So when I click on the button I need the mouse pointer, when in MapView, to turn into an arrow (like the Select Feature arrow). Right now it only turns into the Pan (hand).

This is how my current code looks like:

Public Class btnMatareIdentify
 Inherits ESRI.ArcGIS.Desktop.AddIns.Button
 Public Sub OnClick(ByVal cursorID As Object)
 Dim app As IApplication
 Dim appCursor As IMouseCursor = New MouseCursorClass
 Dim pMxDoc As IMxDocument
 Dim pActiveView As IActiveView
 pMxDoc = My.Document
 pActiveView = pMxDoc.ActiveView
 If TypeOf pActiveView IsNot IPageLayout Then
 appCursor.SetCursor(0) 
 myMethod()
 Else
 MsgBox("You need to be in MapMode")
 End If
 End Sub
End Class
asked Mar 7, 2020 at 12:28

1 Answer 1

1

Please see here for using the IMouseCursor method to display other cursors:

IMouseCursor Help 10.5

Be aware that the cursor will return to the default as soon as the calling procedure ends.

That being said I'm wondering what you are trying to achieve here? Usually a button just executes some action and then ends so you wouldn't change the cursor to anything but a wait cursor. Depending on what you want to do a Tool might be what you are looking for. It has a property for the cursor and when activated it displays that cursor.

Create a Custom Tool

answered Mar 10, 2020 at 18:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.