This document is archived and information here might be outdated.  Recommended version.


IMapControl2.TrackRectangle Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IM > IMapControl2 Interface > IMapControl2.TrackRectangle Method
ArcGIS Developer Help

IMapControl2.TrackRectangle Method

Rubber-bands a rectangle on the MapControl.

[Visual Basic .NET]
Public Function TrackRectangle ( _
) As IEnvelope
[C#]
public IEnvelope TrackRectangle (
);
[C++]
HRESULT TrackRectangle(
void
);

Product Availability

Available with ArcGIS Engine.

Description

Use the TrackRectangle method within the IMapControlEvents2::OnMouseDown event to rubberband a user defined rectangle. The IMapControlEvents2::OnMouseMove event will be triggered during the track, but no IMapControlEvents2::OnMouseUp event will occur. The ESC key on the keyboard can be used during the track to cancel the TrackRectangle.

See Also

IMapControl2 Interface | IMapControl4.TrackCircle Method | IMapControl3.TrackCircle Method | IMapControl2.TrackCircle Method | IMapControl2.TrackLine Method | IMapControl3.TrackLine Method | IMapControl4.TrackLine Method | IMapControl4.TrackPolygon Method | IMapControl2.TrackPolygon Method | IMapControl3.TrackPolygon Method

.NET Samples

Geoevents in a MapControl