Control.GetChildAtPoint 方法

定义

检索指定位置的子控件。Retrieves the child control at a specified location.

重载

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)

检索位于指定坐标处的子控件。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);
member this.GetChildAtPoint : System.Drawing.Point -> System.Windows.Forms.Control
Public Function GetChildAtPoint (pt As Point) As Control

参数

pt
Point

一个 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.

返回

Control,它表示位于指定点处的控件。A Control that represents the control that is located at the specified point.

注解

如果指定点处没有子控件,则 GetChildAtPoint 方法返回 nullIf there is no child control at the specified point, the GetChildAtPoint method returns null.

安全性

UIPermission
对于所有窗口,如果返回的控件不是控件的子控件,则调用此方法。for all windows to call this method if the control returned is not a child of the control. 关联枚举: UIPermissionWindowAllWindows 值。Associated enumeration: AllWindows value of UIPermissionWindow.

另请参阅

GetChildAtPoint(Point, GetChildAtPointSkip)

检索位于指定坐标的子控件,并且指定是否忽略特定类型的子控件。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);
member this.GetChildAtPoint : System.Drawing.Point * System.Windows.Forms.GetChildAtPointSkip -> System.Windows.Forms.Control
Public Function GetChildAtPoint (pt As Point, skipValue As GetChildAtPointSkip) As Control

参数

pt
Point

一个 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

GetChildAtPointSkip 值之一,确定是否忽略特定类型的子控件。One of the values of GetChildAtPointSkip, determining whether to ignore child controls of a certain type.

返回

指定坐标处的子 ControlThe child Control at the specified coordinates.

适用于