This documentation is archived and is not being maintained.

Control.FromChildHandle Method

Retrieves the control that contains the specified handle.

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


The window handle (HWND) to search for.

Return Value

The 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.


This method searches up the window handle parent chain until it finds a handle that is associated with a control. This method is more reliable than the FromHandle method, because it correctly returns 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