API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.OrderIsInFrontOf method
Determines whether or not one shape is in front of another
Syntax:
Function OrderIsInFrontOf(ByVal Shape As Shape) As Boolean
Parameters:
Name Type Description
Shape
Remarks:
The OrderIsInFrontOf method determines whether a shape is in front of a specified shape in the stacking order.
Examples:
The following VBA example fills, with red, all shapes above the selected one.
Sub Test()
Dim s As Shape, ss As Shape
Set s = ActiveShape
For Each ss In ActiveLayer.Shapes
  If ss.OrderIsInFrontOf(s) And Not ss Is s Then

 ss.Fill.UniformColor.RGBAssign 255, 0, 0
  End If
Next ss 
End Sub