Opening a published map with the ArcReaderControl

The following steps demonstrate how to get started with the ArcReaderControl by using the Property Pages dialog box tabs supplied with the control and some of the objects exposed by the ArcReaderControl object model. Follow the steps to produce a fully functional Visual Basic application in only a few minutes.

Steps:
  1. Start Visual Basic and create a new Standard EXE project from the New Project dialog box.
  2. Click the Project menu, click Components, click ESRI ArcReaderControl, then click OK.
  3. The control will now appear in the Visual Basic toolbox Visual basic toolbox.

  4. Click the ArcReaderControl icon in the Visual Basic toolbox to place the ArcReaderControl on a form, then click and drag from one corner to the opposite corner. Alternatively, double-click the ArcReaderControl icon in the Visual Basic toolbox, and the ArcReaderControl will automatically be placed on the form. Rearrange the control position and resize the control to be similar to that shown below.
  5. ArcReaderControl dialog box

  6. Right-click the ArcReaderControl and click Properties to open the ArcReaderControl Property Pages dialog box. Click the General tab, then click the browse document button Open. Navigate to a folder containing a .pmf document of your choice and highlight it. (Be sure the .pmf you choose was published with permission to load into a customized ArcReader application.) Click the Open button, then click Apply on the Property Pages dialog box to link the .pmf in the ArcReaderControl.
  7. Property Pages dialog box
  8. Click the View tab and choose Map Identify from the Map Default tool drop-down list, then choose Layout Zoom In from the Page Layout Default tool drop-down list and click Apply.
  9. Property Pages dialog box
  10. Click OK to close the ArcReaderControl Property Pages dialog box.
  11. Add a command button to the form with the name cmdFullExtent and the caption Full Extent. Position the command button to be similar to that shown below.
  12. ArcReaderControl dialog box
  13. Double-click the Full Extent button to display its click event in the code window. Enter or copy the following code into the click event as shown below.
  14. 'If the current view is a page layout zoom to the whole page
    If ArcReaderControl1.CurrentViewType = esriARViewTypePageLayout Then
    	ArcReaderControl1.ARPageLayout.ZoomToWholePage
    'If the current view is a map (data view) zoom to the full extent of the data
    ElseIf ArcReaderControl1.CurrentViewType = esriARViewTypeMap Then
    	ArcReaderControl1.ARPageLayout.FocusARMap.ZoomToFullExtent
    End If
    Full Extent code example
  15. Click the Run menu and click Start, or press F5, to start the application. Toggle layer visibility by interacting with the check boxes in the table of contents. Use the Layout Zoom In tool in layout view to navigate around the page. Use the Map Identify tool in map view to identify features in the focus map and navigate around them. Click Full Extent to zoom to the full extent of the data or the full extent of the page, depending on the current view.
    Identify Features example
TipTip:
  1. Map publishers can create maps that are not usable in a custom ArcReader application. If a map will not open, use the Published Map Information tool to check its properties. The Published Map Information tool is part of the ArcGIS Desktop Developer Kit installation.
  2. Your compiled executable can be delivered to and used by anyone with the same or a newer version of ArcReader.

Related Topics


3/24/2011