Visual Basic Reference

ContainerHWnd Property

See Also    Example    Applies To

Returns the window handle (hWnd) of a UserControls container.

Syntax

object.ContainerHWnd

The object placeholder represents an object expression that evaluates to a UserControl object.

Remarks

The ContainerHWnd property returns the handle of the container on which a UserControl object is sited. The ContainerHWnd can be passed as a parameter to Windows API calls that require an hWnd parameter.

When the Windowless property of a UserControl is set to True, the UserControl doesnt have a handle of its own. In some cases, the ContainerHWnd property can be used in place of the hWnd property for UserControls to get information about a window. The ContainerHWnd should not be used for Windows API calls that modify the hWnd value.