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.QueryCursor Event

Occurs when the map control should display a cursor.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public event QueryCursorEventHandler QueryCursor

#Event Data

The QueryCursor event's data class is QueryCursorEventArgs. The following properties provide information specific to this event:

Property Description
Action Returns the action that makes the map control change the cursor icon.
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
Cursor Gets or sets the cursor displayed in the map control.

#Remarks

The following example shows how to substitute the cursor displayed when a user scrolls the map with the Arrow cursor:

using DevExpress.XtraMap;
using System;
using System.Windows.Forms;

namespace MapQueryCursor {
    public partial class Form1 : Form {
        private void Form1_Load(object sender, EventArgs e) {
            //...
            mapControl1.QueryCursor += OnMapQueryCursor;
        }
        private void OnMapQueryCursor(object sender, QueryCursorEventArgs e) {
            if (e.Action == QueryCursorAction.MoveMap) {
                e.Cursor = Cursors.Arrow;
            }
        }
    }
}
See Also