Export (0) Print
Expand All
Expand Minimize

Control.FromChildHandle Method

Retrieves the control that contains the specified handle.

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

Parameters

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

Remarks

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.

Requirements

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

Show:
© 2014 Microsoft