How do I make an internal control of a control detect the DragEnter and / or DragOver?

2

I'm coding a form where I have to do is drag an item from a ListView to a User Control that contains a FlowLayerPanel .

This user control has different behaviors such as adding new internal controls to the FlowLayerPanel . Adding an internal control has a default behavior that accepts drag and drop from ListView items.

My problem is that the drag and drop is only captured by the parent control and not by the internal controls as shown in the following image:

According to my speculations, apparently, the surface of the parent control is above the internal controls that I add and, therefore, the drag and drop capture is only captured by this control and not the internal controls.

My question is: How do I make the drag and drop detected by the internal control and not by the parent control that contains it?

    
asked by drielnox 02.03.2016 в 18:50
source

1 answer

0

I think it occurs because you activate the DragEnter / DragOver event only in the container. If you want that the dragged controls also cotrolen the event, you have to activate it also in these. As the controls it contains will be decided when using the application, you can activate the event on each object dragged on the container at run time, when controlling the DragEnter / DragOver (of the container).

Events in C # are activated and controlled by object. A container is a type of object, like the one you mention, it is an object that contains controls (objects); The events activated in the container are controlled with respect to the container, not with respect to the controls it contains, unless they are also activated in these.

    
answered by 18.07.2016 в 15:16