SetRubberBandRect method (Main Control)

Visual Basic example
Visual C++ 4.0 example

Visual J++ example

Syntax void SetRubberBandRect (float fLeft, float fTop, float fWidth, float fHeight);

Overview:  Refer to Marking a Selection with a Rubberband

Remarks

Sets the position and size of a rubberband, which is a one-pixel outline of a rectangle on the display surface.

Typically, you would use this method to outline an area that the user selects with a mouse. The unit of measure is determined by the ScaleMode property. This method works with the following properties:

Use the AutoRubberBand property property to automate the rubberband so that it appears whenever the mouse is moved with the left button down 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

See Also

Topics:  Working with the Control: Client Area Usage