ThinkGeo.com    |     Documentation    |     Premium Support

Can't DragDrop to map

The following event that was in v10 no longer fires in v14. I am setting AllowDrop to true for the MapView.

WinMap.DragDrop += WinformsMap1_DragDrop;

    private void WinformsMap1_DragDrop(object sender, DragEventArgs e)
    {
        // Add files to the layout based on their type
        string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false);

        AddFiles(files);

    }

Regards,
Damian

Hi Damian,

You are right. The Winforms in v14 is a subclass of ElementHost which hides those Drag events. We just add them back, just pull the latest beta (ThinkGeo.UI.WinForms beta088) and the following events now would work as expected.

   mapView.DragDrop += (o, args) =>
       { };
   mapView.DragEnter += (o, args) =>
       { };
   mapView.DragLeave+= (o, args) =>
       { };
   mapView.DragOver += (o, args) =>
       { };

Thanks,
Ben

It works, thanks!

Regards,
Damian

That’s awesome! :+1: