Occurs when the user drags an item and the mouse pointer is no longer over the client area of this item.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The event is raised when the user drags the cursor out of the control or the user cancels the current drag-and-drop operation.
The following remarks describe how and when events related to drag-and-drop operations are raised.
The DoDragDrop method determines the item under the current cursor location. It then checks to see if the item is a valid drop target.
Changes in the mouse cursor position, keyboard state, and mouse button state are tracked in the following manner:
If the user moves out of a window, the event is raised.
If the mouse enters another item, the DragEnter for that control is raised.
If the mouse moves but stays within the same item, the DragOver event is raised.
If there is a change in the keyboard or mouse button state, the QueryContinueDrag event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the Action property of the event's QueryContinueDragEventArgs.
If the value of DragAction is Continue, the DragOver event is raised to continue the operation and the GiveFeedback event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the DragDropEffects enumeration.
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing MessageBox.Show with Console.WriteLine or appending the message to a multiline TextBox.
To run the example code, paste it into a project that contains an instance of a type that inherits from ToolStripItem, such as a ToolStripButton or ToolStripMenuItem. Then name the instance ToolStripItem1 and ensure that the event handler is associated with the event.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.