コード例 #1
0
 private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
 {
     //If left mouse button zoom in
     if (e.button == 1)
     {
         axMapControl1.Extent = axMapControl1.TrackRectangle();
     }
     //If right mouse button pan
     else if (e.button == 2)
     {
         axMapControl1.Pan();
     }
 }
コード例 #2
0
 private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
 {
     //Check which button has been pressed by the user
     if (e.button == 1)
     {
         //Left button - Track a Rectangle and use this to set the MapControl's extent
         axMapControl1.Extent = axMapControl1.TrackRectangle();
     }
     else
     {
         //Left or middle button - Pan
         axMapControl1.Pan();
     }
 }