18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BUILDING APPLICATIONS WITH ACTIVEX<br />

Try replacing the label with an empty string. You can use the Esc key on the<br />

keyboard at any time during the edit to cancel it.<br />

Navigating around the focus map using the map<br />

navigation tools will change the extent of the<br />

focus map in the PageLayoutControl and cause<br />

the MapControl to update. Navigating around<br />

the page layout with the page layout navigation<br />

tools will change the extent of the page layout<br />

(not the extent of the focus map in the<br />

PageLayoutControl), so the MapControl will<br />

not update.<br />

Drawing shapes on the MapControl<br />

You will now use the MapControl as an overview window and draw the current<br />

extent of the focus map within the PageLayoutControl on its display. As you<br />

navigate around the data within the data frame of the PageLayoutControl, you<br />

will see the MapControl overview window update.<br />

1. Add the following code to the general declarations area of the form.<br />

Option Explicit<br />

Private m_pToolbarMenu As IToolbarMenu<br />

Private m_pEnvelope As IEnvelope ' The envelope drawn on the MapControl<br />

Private m_pFillSymbol As ISimpleFillSymbol ' The symbol used to draw the<br />

' envelope on the MapControl<br />

Private WithEvents m_pTransformEvents As DisplayTransformation<br />

' The PageLayoutControl's focus map events<br />

2. Create a new private subroutine called CreateOverviewSymbol. This is where you<br />

will create the symbol used in the MapControl to represent the extent of the<br />

data in the focus map of the PageLayoutControl. Add the following code to<br />

the subroutine:<br />

Private Sub CreateOverviewSymbol()<br />

' Get the IRgbColor interface.<br />

Dim pColor As IRgbColor<br />

Set pColor = New RgbColor<br />

' Set the color properties.<br />

pColor.RGB = RGB(255, 0, 0)<br />

' Get the ILine symbol interface.<br />

Dim pOutline As ILineSymbol<br />

Set pOutline = New SimpleLineSymbol<br />

292 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!