API Documentation > CorelDRAW > 2025-v26 > Page > IVGPage
Page.SelectShapesAtPoint method
Select all shapes beneath a given point and return a selection shape
Syntax:
Function SelectShapesAtPoint(ByVal x As Double, ByVal y As Double, ByVal SelectUnfilled As Boolean, Optional ByVal HotArea As Double = -1) As Shape
Parameters:
Name Type Description
x
Double
y
Double
SelectUnfilled
Boolean
HotArea
Double
Specifies the area around the point to include.
Remarks:
The SelectShapesAtPoint method selects all shapes at a specified point in a document. This method creates a new selection and returns the selection-shape object.
Examples:
The following VBA example allows the user to click over a shape. The shape's fill is then changed by shifting its hue by 30°.
Sub Test()
Dim d As Document
Dim sel As Shape, s As Shape
Dim x As Double, y As Double, Shift As Long
Dim c As New Color
Set d = ActiveDocument
d.ShapeEnumDirection = cdrShapeEnumBottomFirst
While d.GetUserClick(x, y, Shift, 100, False, cdrCursorWinArrow) = 0
  Set sel = d.ActivePage.SelectShapesAtPoint(x, y, False)
  If sel.Shapes.Count > 0 Then

 Set s = sel.Shapes(1)

 d.ClearSelection

 s.AddToSelection

 If s.Fill.Type <> cdrUniformFill Then


s.Fill.UniformColor.RGBAssign 255, 0, 0

 Else


c.CopyAssign s.Fill.UniformColor


c.ConvertToHLS


c.HLSHue = (c.HLSHue + 30) Mod 360


s.Fill.ApplyUniformFill c

 End If
  End If
Wend 
End Sub