Question

I have a WPF application which hosts a (activeX) VisioDrawingControl (using WindowsFormsHost) I'm trying to implement a drag&drop behaviour with drag elements from a WPF listbox and drop onto the ActiveX control.

If I add a drop event handler from the XAML I get an exception that says "DragDrop" event is invalid for this activex control". the same exception raises for the other Drag&Drop standard events. If I try to add them from C# code they are not present in the object's members list.

I've tried again using the mouse events but it doesn't work, in fact if the dragging starts outside the ActiveX control, the ActiveX control's MouseUp event is not raised.

Do you have some hints? thank you

Was it helpful?

Solution

I've solved managing the drag and drop behaviour without using the DragDrop class and using instead the mouse down and mouse up events. The first on the listbox(easy), the second on the entire window checking if the coordinates fall into the windowsformshost rectangle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top