Solved! Go to Solution.
<Tool id="myProject_myTool" class="myTool" message="A tool" caption="A tool" tip=A tool" category="My Tools" image="Images\myTool.png" onDemand="false" />
Public Class myTool Inherits ESRI.ArcGIS.Desktop.AddIns.Tool Public Sub New() End Sub Protected Overrides Sub OnUpdate() Me.Enabled = 'your enabling code End Sub
If you're creating this as part of an Add-in, you have to make a modification to the config.esriaddinx file for each tool. You have to add the tag onDemand="False". See the section on Delay loading in the Help for more information<Tool id="myProject_myTool" class="myTool" message="A tool" caption="A tool" tip=A tool" category="My Tools" image="Images\myTool.png" onDemand="false" />
In addition, you'll have to add the code in the tool itself to enable it, which would go in the OnUpdate subPublic Class myTool Inherits ESRI.ArcGIS.Desktop.AddIns.Tool Public Sub New() End Sub Protected Overrides Sub OnUpdate() Me.Enabled = 'your enabling code End Sub