SelectArea method

Selects an area on the map and creates a SelectedArea object. The selected area must be completely inside the map window, that is between 0 and the Width property of the Map object, and 0 and the Height property of the Map object. Use 0 for all parameters to remove the selection from the map.

Applies to

Objects:  SelectedArea

Syntax

object.SelectArea(Top, Left, Width, Height)

Parameters

Part Description
object Required. An expression that returns a SelectedArea object.
Top Required Long. Distance from the top of the map window to the top of the selected area, in pixels.
Left Required Long. Distance from the left side of the map window to the left side of the selected area, in pixels.
Width Required Long. Width of the selected area, in pixels.
Height Required Long. Height of the selected area, in pixels.

Example

    Sub SelectAnAreaOnTheMap()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map
  'Set up application   Set objMap = objApp.ActiveMap   objApp.Visible = True   objApp.UserControl = True
  'Select an area on the map   objMap.SelectedArea.SelectArea 20, 40, 100, 150
  End Sub