Add-in Tool onClick or onSelect?

508
3
09-07-2012 07:20 AM
JohnBarnes
New Contributor
I'm in the process of converting my custom ArcGIS Desktop projects from VBA to .Net.

I have created a few Add-in Tools.  I'm working on a new one and I have gotten to a point where I need to have something happen when the user selects the tool (i.e., turn on a layer).

I am having difficulty finding how to capture the event that fires when the user selects the tool?  Is there an onClick or onSelect event that fires when the user selects the tool?  And how do I implement that event in my code?

Im using Visual Studio 2008 vb.Net, ArcGIS Desktop 10.0

Thanks,

jb
0 Kudos
3 Replies
KevinOrcutt
New Contributor
Yes, there is an "OnClick" sub for a tool. if you use the ArcGIS|Extending ArcObjects|Base Tool template, there will be a provided "OnClick" sub for you to fill out with all of your appropriate code.

Hope this helps,

Kevin Orcutt
GIS Developer/Consultant
City of Cincinnati - Cincinnati Area GIS (CAGIS)
(513) 850-1335 (cell)
Kevin.Orcutt@cincinnati-oh.gov
www.cagis.org
0 Kudos
KenBuja
MVP Esteemed Contributor
The OnClick subroutine is not visible when you create your add-in, but it will be automatically populated when you type in

Protected Overrides Sub OnClick()

See the Help walkthrough on Building custom UI elements using add-ins
0 Kudos
JohnBarnes
New Contributor
Thanks for the replys.

Answered my own question.

The sup is OnActivate.

Thanks,

jb
0 Kudos