This documentation is archived and is not being maintained.

Control.FromHandle Method

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

[Visual Basic]
Public Shared Function FromHandle( _
   ByVal handle As IntPtr _
) As Control
public static Control FromHandle(
 IntPtr handle
public: static Control* FromHandle(
 IntPtr handle
public static function FromHandle(
   handle : IntPtr
) : Control;


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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Control Class | Control Members | System.Windows.Forms Namespace | Handle | Parent