Gambas Documentation - /doc/dragndrop

# Drag & Drop

To implement Drag & Drop, you have to:

- Set the Drop property on controls that could accept drops.

- Start a Drag & Drop operation by using the Drag class. You usually do it in the MouseDrag event of the source control.

- Implement one of the Drag, DragMove or Drop event handlers on the controls that will be able to receive the drops.

The behaviour of the control that receives a drop is the following:

1. If you don't implement the Drag event handler, nor the DragMove event handler, then:

   - If the Drop event handler is implemented, then the drop is accepted.

   - Otherwise, it is rejected.

2. If you implement the Drag event handler, and if the event is stopped, then the drop is rejected and no DragMove event is raised.

3. If you implement the DragMove event handler, and if the event is stopped, then the drop is rejected.