ESRI.ArcGIS.Mobile
MouseWheel Event
See Also  Example Send Feedback
ESRI.ArcGIS.Mobile Namespace > Map Class : MouseWheel Event

Occurs when the mouse wheel moves while the map control has focus.

Syntax

Visual Basic (Declaration) 
<BrowsableAttribute(True)>
Public Event MouseWheel() As EventHandler(Of MapMouseEventArgs)
C# 
[BrowsableAttribute(true)]
public event EventHandler<MapMouseEventArgs> MouseWheel()

Example

Assuming you have a map control called map1, the following example demonstrates how to use MouseWheel event to Zoom In or Zoom Out.
C#Copy Code
private void map1_MouseWheel(object sender, ESRI.ArcGIS.Mobile.MapMouseEventArgs e) 

  ESRI.ArcGIS.Mobile.Geometries.Envelope en = map1.GetExtent(); 
  if (e.Delta < 0) 
  
    en.Resize(Convert.ToInt32((double)en.Width / 20), Convert.ToInt32((double)en.Height / 20));  // zoom out   
  else 
    en.Resize(-Convert.ToInt32((double)en.Width / 20), -Convert.ToInt32((double)en.Height / 20));  // zoom in   
  
  map1.SetExtent(en); 

    

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also