Control.GetChildAtPoint Method

Definition

Retrieves the child control at a specified location.

Overloads

GetChildAtPoint(Point)

Retrieves the child control that is located at the specified coordinates.

GetChildAtPoint(Point, GetChildAtPointSkip)

Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type.

GetChildAtPoint(Point)

Source:
Control.cs
Source:
Control.cs
Source:
Control.cs

Retrieves the child control that is located at the specified coordinates.

public System.Windows.Forms.Control GetChildAtPoint (System.Drawing.Point pt);
public System.Windows.Forms.Control? GetChildAtPoint (System.Drawing.Point pt);

Parameters

pt
Point

A Point that contains the coordinates where you want to look for a control. Coordinates are expressed relative to the upper-left corner of the control's client area.

Returns

A Control that represents the control that is located at the specified point.

Remarks

If there is no child control at the specified point, the GetChildAtPoint method returns null.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

GetChildAtPoint(Point, GetChildAtPointSkip)

Source:
Control.cs
Source:
Control.cs
Source:
Control.cs

Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type.

public System.Windows.Forms.Control GetChildAtPoint (System.Drawing.Point pt, System.Windows.Forms.GetChildAtPointSkip skipValue);
public System.Windows.Forms.Control? GetChildAtPoint (System.Drawing.Point pt, System.Windows.Forms.GetChildAtPointSkip skipValue);

Parameters

pt
Point

A Point that contains the coordinates where you want to look for a control. Coordinates are expressed relative to the upper-left corner of the control's client area.

skipValue
GetChildAtPointSkip

One of the values of GetChildAtPointSkip, determining whether to ignore child controls of a certain type.

Returns

The child Control at the specified coordinates.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9