ArcObjects Library Reference  (Carto)    

MapFrame Example

VBA code, for displaying the locator rectangles for a MapFrame object:

Dim pDoc As IMxDocument
Dim pPageLayout As IPageLayout
Dim pGraphContainer As IGraphicsContainer
Set pDoc = ThisDocument
Set pPageLayout = pDoc.PageLayout
Set pGraphContainer = pPageLayout
  
Dim pElement As IElement
pGraphContainer.Reset
Set pElement = pGraphContainer.Next
While Not pElement Is Nothing
  If TypeOf pElement Is IMapFrame Then
    Dim pMapFrame As IMapFrame
    Set pMapFrame = pElement
    Msgbox pMapFrame.LocatorRectangleCount
  End If
  Set pElement = pGraphContainer.Next
Wend

[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.