API Documentation > CorelDRAW > 2025-v26 > Curve > IVGCurve
Curve.IsOnCurve method
Checks if a point is on curve
Syntax:
Function IsOnCurve(ByVal x As Double, ByVal y As Double, Optional ByVal HotArea As Double = -1) As cdrPositionOfPointOverShape
Parameters:
Name Type Description
x
Double
y
Double
HotArea
Double
Specifies a restricted area on the curve in which to evaluate the position of a point.
Remarks:
The IsOnCurve method determines whether a given point is inside or outside of a curve or over its outline.
Examples:
The following VBA examples creates a rectangle in the active document and converts the rectangle to a curve. The ShowOnCurve function is called, coordinates are passed to the function, and a message box displays each point position in relation to the rectangle.
Sub OnCurve()
Dim s As Shape
Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)
s.ConvertToCurves
ShowOnCurve 1, 1, s.Curve.IsOnCurve(1, 1)
ShowOnCurve 1, 0, s.Curve.IsOnCurve(1, 0)
ShowOnCurve 1, 3, s.Curve.IsOnCurve(1, 3) 
End Sub Private Function ShowOnCurve(x As Double, y As Double, v As cdrPositionOfPointOverShape)
Dim s As String
s = "Point (" & x & "," & y & ") is "
Select Case v
  Case cdrOutsideShape

 s = s & "outside the shape"
  Case cdrOnMarginOfShape

 s = s & "over the outline"
  Case cdrInsideShape

 s = s & "inside the shape"
End Select
MsgBox s End Function