ArcObjects Library Reference  (CatalogUI)    

GxGeographicView Example

Here, for example, is a VBA method that accesses the geographic view's map (as an IActiveView) and zooms in a fixed amount:

[Visual Basic 6.0]
Public Sub ZoomIn() Dim pApp As IGxApplication Set pApp = Application If Not TypeOf pApp.View Is IGxPreview Then Exit Sub Dim pPreview As IGxPreview Set pPreview = pApp.View If Not TypeOf pPreview.View Is IGxGeographicView Then Exit Sub Dim pGeoView As IGxGeographicView Set pGeoView = pPreview.View Dim pActiveView As IActiveView Set pActiveView = pGeoView.Map Dim pExtent As IEnvelope Set pExtent = pActiveView.Extent pExtent.Expand 0.75, 0.75, True pActiveView.Extent = pExtent pActiveView.Refresh 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.