Control.FromChildHandle(IntPtr) 方法

定义

检索包含指定句柄的控件。

public:
 static System::Windows::Forms::Control ^ FromChildHandle(IntPtr handle);
public static System.Windows.Forms.Control FromChildHandle(IntPtr handle);
public static System.Windows.Forms.Control? FromChildHandle(IntPtr handle);
static member FromChildHandle : nativeint -> System.Windows.Forms.Control
Public Shared Function FromChildHandle (handle As IntPtr) As Control

参数

handle
IntPtr

nativeint

要搜索的窗口句柄 (HWND)。

返回

表示 Control 与指定句柄关联的控件;如果未找到具有指定句柄的控件,则 null 返回。

注解

此方法将搜索窗口句柄父链,直到找到与控件关联的句柄。 此方法比 FromHandle 方法更可靠,因为它正确返回拥有多个句柄的控件。

适用于

另请参阅