Control.FromHandle(IntPtr) 方法

定义

返回当前与指定句柄关联的控件。

C#
public static System.Windows.Forms.Control FromHandle (IntPtr handle);

参数

handle
IntPtr

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

返回

Control

Control,它表示与指定句柄关联的控件;如果找不到带有指定句柄的控件,就返回 null

注解

FromChildHandle如果需要返回拥有多个句柄的控件,请使用此方法。

适用于

产品 版本
.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
Windows Desktop 3.0, 3.1, 5, 6, 7

另请参阅