Export (0) Print
Expand All
Expand Minimize

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
[C#]
public static Control FromHandle(
 IntPtr handle
);
[C++]
public: static Control* FromHandle(
 IntPtr handle
);
[JScript]
public static function FromHandle(
   handle : IntPtr
) : Control;

Parameters

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

Remarks

Use the FromChildHandle method if you need to return 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