Mousedown event is not fired

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

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

i copy this and paste in Program.cs


is there something wrong? and Please let me know how to set SendMouseDown in the properties of thec control.
Thank you

i’d like to mark points on this shp

I have the same problems with mousedown event in my 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

Well, I admit it is perplexing. At first look, it looks appropriate. I wrote a simple 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.

Thank you Jerry
i did just like the way you’ve done and it work!
20191129_105413

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