| Message |
Hello Chad,
If you look in Exploring ArcObjects.PDF it says that
TOCDisplayView and TOCSourceView do not currently provide
an implementation for IActiveViewEvents::SelectionChanged.
At this point, the only way to fire any code in response
to the selected layer being changed is to develop a dummy button in standalone VB using the ICommand_Enabled sub-procedure to check if the selected layer has been changed.
The enabled procedure is fired every couple of seconds.
Open VB and stub out the code for the ICommand interface.
In the ICommand_Enabled sub write code that gets the currently selected layer and compares its name to the current value of a string variable. If the value has changed, then call a function that carries out whatever task you want carried out.
I have provided a sample. Compile the module into
a .dll and then add the button to your mxd.
When the selected layer is changed, the sub-routine
that the ICommand_Enabled procedure calls will execute.
|