# Mousedown event is not fired

**URL:** <https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352>\
**Category:** MapWinGIS\
**Created:** [November 25, 2019, 8:46am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352 "2019-11-25T08:46:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![james](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@james](https://mapwindow.discourse.group/u/james)\
**Post date:** [November 25, 2019, 8:46am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/1 "2019-11-25T08:46:20Z")

</div>

![20191125_173947](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/221294a6a2604e252701423ce62adb35c27fe004.jpeg)

i have a problem about mousedown event.

i filled the code as mentioned in MarkPoints.cs and already have enabled SendMouseDown but nothing happened.

how can i make it work?

Thanks

---

<div class="post-metadata">

**Author:** ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)\
**Post date:** [November 26, 2019, 1:20pm UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/2 "2019-11-26T13:20:05Z")

</div>

Can you also show where you set `SendMouseDown` or did you set it in the properties of the control?

---

<div class="post-metadata">

**Author:** ![james](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@james](https://mapwindow.discourse.group/u/james)\
**Post date:** [November 27, 2019, 4:33am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/3 "2019-11-27T04:33:22Z")

</div>

i copy this and paste in Program.cs

 ![20191127_132118](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/2203151faed721ecd71981c71b1434846584dcfb.png)  
is there something wrong? and Please let me know how to set SendMouseDown in the properties of thec control.  
Thank you

---

<div class="post-metadata">

**Author:** ![james](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@james](https://mapwindow.discourse.group/u/james)\
**Post date:** [November 27, 2019, 4:34am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/4 "2019-11-27T04:34:52Z")

</div>

i’d like to mark points on this shp

 ![20191127_132236](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/54e88cb9cdf61b54d8249ca2bb65a8243bd21a4e.png)

---

<div class="post-metadata">

**Author:** ![Eugene](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Eugene](https://mapwindow.discourse.group/u/Eugene)\
**Post date:** [November 27, 2019, 5:07am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/5 "2019-11-27T05:07:28Z")

</div>

I have the same problems with mousedown event in my [VB.NET](http://VB.NET) applications. SendMouseDown=true is set when the tool is selected. In the AxMap control itself, SendMouseDown=false. The ShapeHighlighted event also does not work. Empirically, I determined that if replaced in a compiled project AxInterop.MapWinGIS.dll and Interop.MapWinGIS.dll on older versions 4.9.0, everything starts to work. But after rebuilding the project these events cease to be worked out

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [November 27, 2019, 5:52am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/6 "2019-11-27T05:52:26Z")

</div>

Well, I admit it is perplexing. At first look, it looks appropriate. I wrote a simple [VB.NET](http://VB.NET) app, and it raises the event just as it should

```
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    With AxMap1
        .Projection = tkMapProjection.PROJECTION_NONE
        .GrabProjectionFromData = True
        .SendMouseDown = True
        .CursorMode = tkCursorMode.cmNone
    End With
End Sub

Private Sub AxMap1_MouseDownEvent(sender As Object, e As _DMapEvents_MouseDownEvent) Handles AxMap1.MouseDownEvent
    Debug.WriteLine("MouseDownEvent")
End Sub

```

Perhaps I don’t know enough about c# in this case, but why is the following reference using MapEvents?

```
MapEvents.MouseDownEvent += AxMap1MouseDownEvent;

```

I threw together a quick c# app, and set up the event as follows, using axMap1, not MapEvents:

```
    public Form1()
    {
        InitializeComponent();

        axMap1.CursorMode = MapWinGIS.tkCursorMode.cmNone;
        axMap1.SendMouseDown = true;
        axMap1.MouseDownEvent += AxMap1_MouseDownEvent;
    }

    private void AxMap1_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e)
    {
        throw new NotImplementedException();
    }

```

Respectfully,  
Jerry.

---

<div class="post-metadata">

**Author:** ![james](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@james](https://mapwindow.discourse.group/u/james)\
**Post date:** [November 29, 2019, 1:56am UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/7 "2019-11-29T01:56:51Z")

</div>

Thank you Jerry  
i did just like the way you’ve done and it work!  
 ![20191129_105413](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/4473cb3ec8a4b711b35b62a0363da31ebe02ea78.png)

---

<div class="post-metadata">

**Author:** ![Eugene](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Eugene](https://mapwindow.discourse.group/u/Eugene)\
**Post date:** [November 30, 2019, 2:51pm UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/8 "2019-11-30T14:51:46Z")

</div>

I solved my problem too. This is due to the MapWinGis API update. Maybe someone will find it useful.  
After updating the MapWinGis API in your projects, check the folders …YouProject\bin\Debug and …YouProject\obj\Debug. In that folders remain old versions of AxInterop.MapWinGIS.dll.  
Replace them with new versions that can be taken from the folder …YouProject\bin\Release or …YouProject\obj\Release. Now after compiling the project all functions will work

---

<div class="post-metadata">

**Author:** ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)\
**Post date:** [December 19, 2019, 3:25pm UTC](https://mapwindow.discourse.group/t/mousedown-event-is-not-fired/352/9 "2019-12-19T15:25:07Z")

</div>


