We have a heavily customised ArcIMS application which we use to show demographic point and polygon data.
Recently the custodian of the system requested that I add in functionality to allow the user to drag and drop a box to select multiple points or polygons. The existing functionality was calling the IdentifyAll tool which meant you could only click one point on the map, whereas the new tool that I have added in uses the SelectBox tool which can select multiple objects.
The new tool works fine but I am having problems ensuring that a layer is active in the window when the tool is clicked.
The problem is that our TOC is, again, heavily customised and removes the need to click refresh in the TOC in order to switch on/off layers or make them active. There is a line of code that makes a layer visible and active as soon as the checkbox for that layer is clicked. Along with this code, there is an else statement (i.e. when a box is unchecked), that switches the layer off. However, the last layer that was checked remains active even if you uncheck it in the TOC.
So if you switch on layer A and then switch on layer B but then switch off layer B and try to use the select tool, ArcIMS still has layer B as the active layer and the select tool wont work. I need to make layer A (essentially the one before last layer that was active) the new active layer.
Happy to provide screen shots or code if required.
Many thanks in advance.