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.

適用於