IContentsView Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > ArcObjects namespaces > ArcMapUI > ESRI.ArcGIS.ArcMapUI > Interfaces > IC > IContentsView Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (ArcMapUI)  

IContentsView Interface

Provides access to members that control table of contents views.

Product Availability

Available with ArcGIS Desktop.

Description

Used to manage a contents view. The tabs in ArcMap's Table of Contents (TOC) are examples of a contents view.

Members

Name Description
Method Activate Activates the contents view.
Method AddToSelectedItems Adds to the selected items.
Read/write property ContextItem The context item (could be an enumerator).
Method Deactivate Deactivates the contents view.
Read-only property hWnd The HWND of the contents view.
Read-only property Name The name of the contents view.
Write-only property ProcessEvents Indicates if the view is currently responding to events.
Method Refresh Refreshes the contents view. If a non-null item is specified, it refreshes only that item and its children.
Method RemoveFromSelectedItems Removes an item from the selected items.
Read/write property SelectedItem The selected item (could be an enumerator).
Read/write property ShowLines Indicates if lines are shown in the TOC tree.
Read/write property Visible Indicates if the view is visible.

CoClasses that implement IContentsView

CoClasses and Classes Description
TOCCatalogView Esri TOC Catalog View.
TOCDisplayView Esri TOC Display View.
TOCLegendDisplayView
TOCLegendSelectionView
TOCSelectionView Esri TOC Selection View.

Remarks

Use IContentsView to show or hide a view or to get or set selected items in a view. Selected items in the TOC's Display and Catalog View can include data frames, layers, legend groups, and legend classes. Additionally, standalone tables, workspaces, and datasets can be selected in the TOC's Catalog View. No items can be selected in the TOC's Selection view. To learn more about selected items, read the topics for Selected Item, AddToSelectedItems, and RemoveFromSelectedItems.

.NET Snippets

Get Selected Geodataset in Contents View | Zoom to Active Layer in TOC | Set Data Source | Get Selected Feature Layer in Contents View | Get Selected Table in Contents View | Get FeatureClass of Selected Feature Layer in Contents View | Get Contents View from ArcMap

.NET Samples

Custom UI elements using add-ins (Code Files: ZoomToLayerButton) | Use an AlgorithmicColorRamp to color a ClassBreaksRenderer (Code Files: AlgorithmicColorRamp) | Create a command by inheriting from BaseCommand (Code Files: ZoomToLayer)

.NET Related Topics

Create a command by inheriting from BaseCommand