This documentation is archived and is not being maintained.

Control.FromHandle Method

Returns the control that is currently associated with the specified handle.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

public static Control FromHandle (
	IntPtr handle
public static Control FromHandle (
	IntPtr handle
public static function FromHandle (
	handle : IntPtr
) : Control
Not applicable.



The window handle (HWND) to search for.

Return Value

A Control that represents the control associated with the specified handle; returns a null reference (Nothing in Visual Basic) if no control with the specified handle is found.

Use the FromChildHandle method if you need to return controls that own more than one handle.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0