MapWinGIS:AxMap MouseDown

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

MouseDown

This event is fired when a user has pressed a mouse button while the cursor is inside the map control. The map property SendMouseDown must be set to True for this event to be fired.
See also SendMouseDown


VB.NET Usage

Event MouseDownEvent(Sender As Object, e As AxMapWinGIS._DMapEvents_MouseDownEvent)

            Parameters

Sender

The sender of the event.
e.button The button pressed on the mouse to create this event.
e.shift The shift/ctrl modifiers pressed during the creation of this event.
e.x The x coordinate of this event in pixel coordinates.
e.y The y coordinate of this event in pixel coordinates.

Sample Code

    Private Sub Map1_MouseDownEvent(ByVal sender As Object, ByVal e As AxMapWinGIS._DMapEvents_MouseDownEvent) Handles Map1.MouseDownEvent
        'This will draw a point where you click on the map if you have a 
        'spatially referenced shapefile or grid displayed on the map
        Dim x As Double, y As Double
        'Convert pixel coordinates of mouse up event e.x and e.y to projected coordinates returned by x and y
        Map1.PixelToProj(e.x, e.y, x, y)
        'Create a new drawing layer in map1
        Map1.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList)
        'Draw a red point where the mouse up event occured in map1
        Map1.DrawPoint(x, y, 5, System.Convert.ToUInt32(RGB(255, 0, 0)))
    End Sub
  

VB 6 Usage
Event MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
            Parameters

Button

The button pressed on the mouse to create this event.
Shift The shift/ctrl modifiers pressed during the creation of this event.
x The x coordinate of this event in pixel coordinates.
y The y coordinate of this event in pixel coordinates.

Sample Code

    Private Sub Map1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
        'This will draw a point where you click on the map if you have a
        'spatially referenced shapefile or grid displayed on the map
        Dim px As Double, py As Double
        'Convert pixel coordinates of mouse down event e.x and e.y to projected coordinates returned by x and y
        Map1.PixelToProj x, y, px, py
        'Create a new drawing layer in map1
        Map1.NewDrawing (dlSpatiallyReferencedList)
        'Draw a red point where the mouse down event occured in map1
        Map1.DrawPoint px, py, 5, RGB(255, 0, 0)
    End Sub

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:AxMap_MouseDown"

This page has been accessed 2,529 times. This page was last modified on 9 November 2005, at 18:37.