System.Windows.Forms.Control.DragDrop Event

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

Syntax

public event DragEventHandler DragDrop

Remarks

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.

Example

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

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.

Requirements

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