ZOrderPosition property
Returns or sets the position of the specified shape within the Shapes collection, in order from back (bottom) to front (top) as displayed on the map. 1-based. Read/write Long.
Applies to
Objects: Shape
Syntax
object.ZOrderPosition
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a Shape object. |
Remarks
To move a shape in front of or behind other shapes, use the ZOrder method on the Shape object.
Example
Sub BringOvalToFront()
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, then zoom in
Set objMap.Location = objLoc
objMap.Shapes.AddShape geoShapeOval, objLoc, 50, 30
objMap.Shapes.AddShape geoShapeRectangle, objLoc, 40, 30
'Change color of oval so we can see it, then set
' the ZOrderPosition of the oval so that it is in front
objMap.Shapes.Item(1).Line.ForeColor = vbBlue
objMap.Shapes.Item(1).ZOrderPosition = 2
End Sub