ArcGIS Developer Help  (Carto)    

IGraphicsContainerSelect Example

[Visual Basic 6.0]

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

[Visual Basic .NET, C#, C++]
No example is available for Visual Basic .NET, C#, or C++. To view a Visual Basic 6.0 example, click the Language Filter button Language Filter in the upper-left corner of the page.