Hook to TOC selection change event

1569
3
09-18-2012 06:23 AM
DavidLednik
Occasional Contributor II
How do I hook to selection change event (or OnMouseDown) of ArcMap TOC from a custom plugin.
I have a plugin that has an extension and dockable window and I need to update the window with information every time you select a new layer in TOC. Is this even possible?
0 Kudos
3 Replies
NeilClemmons
Regular Contributor III
I don't think there's any way to listen for the actual event.  One solution would be to put a timer on your dockable window that would fire every second or so and get the selected item from the TOC contents view.
0 Kudos
DavidLednik
Occasional Contributor II
That's what I'm doing now 😉
0 Kudos
by Anonymous User
Not applicable
I put together an example showing how to subclass the SysTreeView32 (TOC) and listening to selection change events:

http://gis.stackexchange.com/a/34473/4689

Regards,
Christian
0 Kudos