ArcObjects Library Reference  (Controls)    

TOCControl CoClass

ESRI TOCControl

Product Availability

Available with ArcGIS Engine.

Description

The TOCControl displays a 'Table of Contents' view of maps, layers and layer symbology available from the IActiveView and IBasicMap interfaces. The TOCControl works in conjunction with a 'buddy' control or an object implementing IActiveView. A MapControl, PageLayoutControl, SceneControl or GlobeControl can be a 'buddy'. The TOCControl obtains access to the 'buddy' through the ITOCBuddy interface. The TOCControl manages layer visibility and label editing.

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.

Interfaces

Interfaces Description
IConnectionPointContainer Supports connection points for connectable objects.
IPersist Defines the single method GetClassID, which is designed to supply the CLSID of an object that can be stored persistently in the system. IPersist is the base interface for three other interfaces: IPersistStorage, IPersistStream, and IPersistFile.
IPersistStreamInit Supports initialized stream-based persistence, regardless of whatever else the object does.
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.
ITOCControl Provides access to members that control the TOCControl.
ITOCControl2 Provides access to members that control the TOCControl.
ITOCControlDefault Provides access to members that control the TOCControl.

Event Interfaces

Interfaces Description
ITOCControlEvents (default) Provides access to events that occur with interaction to the TOCControl.

Remarks

There is no need to declare the TOCControl's outbound interface as described below in most development environments, because the interface is automaticlly implemented.

[Visual Basic 6.0]

To create a TOCControl programmatically use the following code:

Dim pTOCControl As esriControls.ITOCControl
Set pTOCControl = CreateObject("esriControls.TOCControl")

Working with Events

[Visual Basic 6.0]

When working with TOCControl's default outbound interface in Visual Basic 6 declare variables as follows:

Private WithEvents pTOCControl as TOCControl