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

Once the user lets up on the mouse, the rubber band event fires and the band disappears form the screen.

Handle the event manually to specify whether to leave the rubber band visible on the screen. Use the SetRubberBandRect method to set the size and position of the rubberband and process the mouse event.

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

RubberBandVisible property

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