Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

MapControl.ScrollArea Property

Gets or sets a rectangular area (also called scroll area) that confines the map center point.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public MapBounds ScrollArea { get; set; }

#Property Value

Type Description
MapBounds

The boundaries that specify the area in which the map center point can be moved around.

#Remarks

Use this property to limit scroll operations so that the map center point remains within the boundaries. To define these boundaries, specify the coordinates of the area’s top-left and bottom-right corners.

In the following animation, a rectangle depicts the scroll area boundaries and a dot indicates the map center position:

#Example

This example specifies a rectangular area that confines the map center point:

using DevExpress.XtraMap;
using System;
using System.Drawing;
using System.Windows.Forms;
//...
    private void Form1_Load(object sender, EventArgs e) {
        mapControl1.ScrollArea = new DevExpress.Map.MapBounds(
            new GeoPoint(44.568441, -11.877712), 
            new GeoPoint(36.219329, 4.030490));
        mapControl1.CenterPoint = new GeoPoint(40.155242, -2.912869);
        mapControl1.ZoomLevel = 4.5;
    }
//...        
See Also