ClipControls

Returns or sets a value that determines whether graphics methods in Paint events repaint the entire object or only newly exposed areas. Also determines whether the Microsoft Windows CE operating environment creates a clipping region that excludes non-graphical controls contained by the object. Read-only at run time.

Syntax

object.ClipControls

The parts of the ClipControls property syntax are described in the following table.

Part Description
object An object expression that evaluates to an object.
boolean A Boolean expression that specifies how objects are repainted, as described in Settings.

Settings

The settings for boolean are described in the following table.

Setting Description
True (Default). Graphics methods in Paint events repaint the entire object. A clipping region is created around nongraphical controls on the form before a Paint event.
False Graphics methods in Paint events repaint only newly exposed areas. A clipping region is not created around nongraphical controls before a Paint event. Complex forms usually load and repaint faster when ClipControls is set to False.

Remarks

Clipping is the process of determining which parts of a form or container, such as a Frame control, are painted when the form is displayed. An outline of the form and controls is created in memory. The Windows operating environment uses this outline to paint some parts, such as the background, without affecting other parts, such as the contents of a TextBox control. Because the clipping region is created in memory, setting this property to False can reduce the time needed to paint or repaint a form.

The clipping region includes most controls, but does not clip around the Label, DrawLine, or Shape controls.

Avoid nesting intrinsic controls with ClipControls set to True inside a control with ClipControls set to False (for instance, a command button inside a frame). This kind of control nesting causes the controls to repaint incorrectly. To fix this problem, set the ClipControls property for both the container control and the nested controls to True.