Windowless Property

       

Returns or sets a value that defines whether a UserControl is assigned a window handle (hWnd) at run time.

Syntax

object.Windowless [= boolean]

The Windowless property syntax has these parts:

Part Description
object A UserControl object.
boolean Determines whether a UserControl's hWnd property returns a valid hWnd.

Settings

The settings for Windowless are:

Setting Description
True The UserControl isn’t assigned an hWnd at run time.
False (Default) The UserControl is assigned an hWnd at run time.

Remarks

You can use the Windowless property to reduce the resource usage of your controls. By default, each instance of a UserControl object is assigned a window handle (referenced in the hWnd property) which consumes system resources. If the Windowless property is set to True, the hWnd property will always return 0.

In general, you should consider setting the Windowless property to True unless you need to access API calls which require an hWnd parameter or unless your control will act as a control container.

This property can only be set at design time.

Note   Not all containers support Windowless controls. If a Windowless UserControl is sited on a container that doesn’t support it, it will be assigned an hWnd and the Windowless property will be ignored.