ZOrder method
Moves the specified shape in front of or behind other shapes in the Shapes collection or roads on the map; similar to using the Draw menu entries on the Drawing toolbar.
Applies to
Objects: Shape
Syntax
object.ZOrder(ZOrderCmd)
Parameters
Part | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | Required. An expression that returns a Shape object. | |||||||||||||||||||||
ZOrderCmd | Required GeoZOrderCmd. Indicates where to move the specified shape relative to other shapes in the collection, and to roads on the map.
|
Remarks
To return the position of a shape within a Shapes collection, use the ZOrderPosition property of the Shape object.
Example
Sub BringRectangleForward()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location
'Set up application and get a location object
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
Set objLoc = objApp.ActiveMap.GetLocation(0, 0)
'Create two shapes at this location and zoom to this location
Set objMap.Location = objLoc
objMap.Shapes.AddShape geoShapeRectangle, objLoc, 20, 30
objMap.Shapes.AddShape geoShapeRadius, objLoc, 30, 40
'Change the rectangle color, then bring it to the front
objMap.Shapes.Item(1).Line.ForeColor = vbBlue
objMap.Shapes.Item(1).ZOrder geoBringForward
End Sub