English

FAQ: Is there an event triggered when the user changes or selects a layer in ArcMap's TOC?

Question

Is there an event triggered when the user changes or selects a layer in ArcMap's TOC?

Answer

No. There is currently no outbound interface that supports this event.

As a workaround, use a Timer Control to call IMxDocument::SelectedLayer on the MxDocument CoClass. Alternatively, call IMxDocument::SelectedLayer from the Enabled property of an ICommand.

Note:
ICommand::Enabled gets hit often and can be used, with caution, for code that must run frequently.