The TOCControl (table of contents)


The TOCControl works in conjunction with a buddy control. The buddy control can be a MapControl, PageLayoutControl, ReaderControl, SceneControl, or GlobeControl. The buddy control can be set at design time through the TOCControl property pages (in development environments that support property page capability) or programmatically using the SetBuddyControl method when the container hosting the TOCControl is displayed.
A TOCControl application
Each TOCControl buddy control implements the ITOCBuddy interface. The TOCControl works with the buddy control to display an interactive tree view of its map, layer, and symbology contents and to keep its contents synchronized with the buddy control. For example, if the TOCControl has a MapControl as its buddy, and a map layer is removed from the MapControl, the map layer will also be removed from the TOCControl. Likewise, if the end user interacts with the TOCControl to uncheck a map layer's visibility, the layer will no longer be visible within the MapControl.

Layer drag and drop

The TOCControl can support the dragging and dropping of layers within the control when the ITOCControl2::EnableLayerDragDrop property is set. Layers can be moved or copied (by using the CTRL key) in the following ways: within a map; within, to and from group layers; between maps; between maps in different TOCControl's; and from ArcMap.

Selected item

An item can be selected in the TOCControl, either interactively by the end user clicking on the TOCControl, or programmatically using ITOCControl2::SelectItem method. The ITOCControl2::GetSelectedItem method returns the selected item.






Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced