Marking a Selection with a Rubberband

You can mark a selection area by using a rubberband, which is a one-pixel rectangle on the display surface.

The following property lets you automate the rubberband so that it appears whenever the mouse is moved with the left button down:

AutoRubberBand property

Alternatively, you can control the rubberband by adding code to the mouse events. You can use the following method to set the size and position of the rubberband:

SetRubberBandRect method

You can use the following property to change the visibility of the rectangle, effectively turning it on or off:

RubberBandVisible property

You can use the following properties to get or set the current size and position of the rectangle:

RubberBandHeight property

RubberBandLeft property

RubberBandTop property

RubberBandWidth property

The following event occurs before the MouseUp event when the rubberband is turned on:

RubberBand event