MapControl.MapItemClick Event

Fires when a map item of the Map Control is clicked.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v20.1.dll

Declaration

public event MapItemClickEventHandler MapItemClick
Public Event MapItemClick As MapItemClickEventHandler

Event Data

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

Property Description
Handled Gets or sets a value specifying whether an event has been handled.
Item Gets a map item to be represented in the map control. Inherited from MapItemEventArgs.
MouseArgs Returns data for the MouseUp, MouseDown, and MouseMove events.

Remarks

The MapItemClick event occurs when a map item is clicked on a map.

Example

The following code invokes a PopupMenu when a user right-clicks a map path:

mapControl1.MapItemClick += OnMapItemClick;
//...    
private void OnMapItemClick(object sender, MapItemClickEventArgs e) {
   if (e.MouseArgs.Button == MouseButtons.Right && e.Item is MapPath) {
        popupMenu1.ShowPopup(Cursor.Position);
   }
}
See Also