ClipControls

This property returns and sets a value that determines whether graphics methods in Paint events repaint the entire object or only newly exposed areas. The property also determines whether Windows CE creates a clipping region that excludes non-graphical controls contained by the object.

Syntax

object.ClipControls [= Boolean]

Parameters

object
Object expression that evaluates to a control.
Boolean
Boolean expression that specifies how objects are repainted, as described in Settings. Following are the settings for Boolean:
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

The ClipControls property is read-only at run time.

The clipping process determines 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. Windows CE 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 it 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 correct this problem, set the ClipControls property for both the container control and the nested controls to True.