Solved! Go to Solution.
Public Class Aggregate Inherits ESRI.ArcGIS.Desktop.AddIns.Button Public Sub New() End Sub Protected Overrides Sub OnClick() Try Dim AggForm As New AggregateForm If AggForm.InitializeForm Then 'sets up the initial view of the form CenterForm(AggForm, My.ArcMap.Application) 'centers the form on the application window AggForm.Show(System.Windows.Forms.Control.FromHandle(My.ArcMap.Application.hWnd)) End If Catch ex As Exception System.Windows.Forms.MessageBox.Show(ex.ToString, "OnClick") End Try ' My.ArcMap.Application.CurrentTool = Nothing End Sub Protected Overrides Sub OnUpdate() Enabled = My.ArcMap.Application IsNot Nothing End Sub End Class
In Arcmap you can only have one tool active at a time, which is reflected in the ArcMap.Application.CurrentTool property.
Buttons that look depressed are simply commands that have their checked property set to true. Example of these include the editor shape constructors, the editor command on the standard toolbar and the snapping types on the snapping toolbar etc.
If you set the currenttool property to null or nothing in your add-in, like Ken does in his example, the current tool is deactivated. The arcmap cursor changes to a default which just happens to be the one used by the select elements tool, hence the confusion.
The add-in wizard template code includes this in the on-click events for buttons so in your case your button is probably deactivating the current tool before showing the modal dialog. Simply remove or comment out this line.
The customize dialog also clears the selected tool and has done so since arcgis 8.