ClipBehavior Property

       

Returns or sets a value that defines the clipping behavior of the HitTest event on a Windowless UserControl object.

Syntax

object.ClipBehavior [= number]

The ClipBehavior property syntax has these parts:

Part Description
object A UserControl object.
number An integer that specifies clipping behavior, as described in Settings.

Settings

The settings for number are:

Constant Setting Description
None 0 The output of graphics methods will appear anywhere within the rectangular bounds of the control.
UseRegion 1 (Default) The output of graphics methods will be clipped to the MaskRegion of your control.

Remarks

You can use the ClipBehavior property to determine where the output of graphics methods will appear on your UserControl. By default, any drawing done using graphics methods will only be visible over the MaskRegion of the control. The MaskRegion consists of any subcontrols plus any mask defined by the MaskPicture and MaskColor properties. Any drawing done outside of the MaskRegion will be invisible.

By setting ClipBehavior to None, drawing will be visible over both the MaskRegion and the TransparentRegion of the control.

When used in combination with the HitBehavior property, this property helps to determine the HitResult argument of the HitTest event.

Note   This property is ignored if the Windowless property of the UserControl object is set to False or if the BackStyle property is set to Opaque.

Important   Not all control containers support the Windowless property. The HitBehavior property should only be changed if you know it will be used in containers that support Windowless activation.