System.Windows.Forms.Control.DragDrop Event

Occurs when a drag-and-drop operation is completed.


public event DragEventHandler DragDrop


The DragEventArgs.X and DragEventArgs.Y properties of the System.Windows.Forms.DragEventArgs are in screen coordinates, not client coordinates. The following line of csprcs code converts the properties to a client System.Drawing.Point.


Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));

In versions earlier than dnprdnext, if you put a System.Windows.Forms.UserControl with Control.DragEnter and Control.DragDrop events on a Windows Form and drag and drop something onto the System.Windows.Forms.UserControl at design time, the DropDrop and DropEnter events are raised. However, when you close and reopen the solution, the Control.DragEnter and Control.DragDrop events are not raised again.

For more information about handling events, see Consuming Events.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0,