API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.OrderToFront method
Moves the shape to the front in the stacking order
Syntax:
Sub OrderToFront()
Remarks:
The OrderToFront method moves a shape to the front of the stacking order.
Examples:
The following VBA example creates a page frame rectangle and places it in front of all other shapes on the active layer.
Sub Test()
Dim Frame As Shape
Set Frame = ActiveLayer.CreateRectangle(0, 0, ActivePage.SizeWidth, _
  ActivePage.SizeHeight)
Frame.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), _
  CreateRGBColor(0, 0, 0)
Frame.OrderToFront
Frame.Locked = True 
End Sub