ArcObjects Component Help  (Core)    

IGraphicsContainerSelect Interface

Provides access to members that control graphic container selection.

When To Use

Most objects which are considered graphics containers, the PageLayout and Map objects for example, implement the IGraphicsContainerSelect interface to expose additional members for managing their element selection.  For example, use IGraphicsContainerSelect::UnselectAllElements to clear an object's graphic element selection.

The following simple VBA example returns the number of elements currently selected in the focus Map and the PageLayout.

Public Sub GraphicSelectionCount()
  Dim pMxDocument As IMxDocument
  Dim pMap As IMap
  Dim pPageLayout As IPageLayout
  Dim pMapGraphicsSelect As IGraphicsContainerSelect
  Dim pPageLayoutGraphicsSelect As IGraphicsContainerSelect
  
  Set pMxDocument = Application.Document
  Set pMap = pMxDocument.FocusMap
  Set pPageLayout = pMxDocument.PageLayout
  Set pMapGraphicsSelect = pMap
  Set pPageLayoutGraphicsSelect = pPageLayout
  MsgBox pMapGraphicsSelect.ElementSelectionCount
  MsgBox pPageLayoutGraphicsSelect.ElementSelectionCount
End Sub

Members

Description
Read/write property DominantElement Dominant element.
Method ElementSelected Indicates if the element is selected.
Read-only property ElementSelectionCount The number of selected elements.
Method SelectAllElements Selects all elements.
Method SelectedElement Returns the nth selected element. Use Selection count to get the number of selected elements.
Read-only property SelectedElements The selected elements.
Method SelectElement Selects the specified element.
Method SelectElements Selects the specified elements.
Read-only property SelectionBounds The bounds of the selection.
Method SelectionTracker Returns the tracker for the nth selected element. Use Selection count to get the number of selected elements.
Method UnselectAllElements Unselects all elements.
Method UnselectElement Unselects the specified element.
Method UnselectElements Unselects the specified elements.

CoClasses that implement IGraphicsContainerSelect

CoClasses and Classes Description
CompositeGraphicsLayer A collection of graphics layers that behave like single layer.
FDOGraphicsLayer A FDO graphics layer.
Map A container for the display and manipulation of map data.
PageLayout Page Layout.

See Also

IGraphicsContainer Interface | IEnumElement Interface | IGraphicsContainerSelect Interface | IActiveView.Selection Property