.net - How do I tell if a Drag Drop has ended in Winforms? -


How do I tell that drag drops have eliminated WinForms .NET. I need to stop part of my form from refreshing it's footage of data when a drag-drop job is in progress.

I've tried using a flag, but I do all events I the I flag with the progress of the drop drag is not to be captured need especially to synchronize Can not tell that the drag drop ends when the end of a drag drop without the end of operation, i.e. when the user will drop items with the drop = false permission or when the user esc Mr. suppresses.

> I have seen this question: -

But it does not satisfy my issue (if someone answers me of this question then I will answer one Along with what I already have)

After

I've got a buyer and finally find out this.

Reply QueryContinueDrag is to monitor the event This incident fire continuously during drag-drop operation. QueryContinueDragEventArgs type contains an action property of Enum DragAction, which is either DragAction.Cancel, DragAction.Drop or DragAction.Continue. It's a read / write property to allow you to change the standard behavior (we do not need this).

This example has code values ​​DragDropInProgress flag set in a drag early drop and reset when a drag-drop is successfully completed, it ends a Dradrop because the user drag drop goal (drag drop goal MyControl1 and MyControl2) have left the mouse or canceled the drag drop. If you do not care if DragDropInProgressFlag reset before your DragDrop events, you can dispense with hit testing and only activates the flag reset.

  private sub MyControl_QueryContinueDrag (ByVal Mauspoisr moved as the object, ByVal System.Windows.Forms.QueryContinueDragEventArgs e) MyControl.ContinueDrag Dim MousePointerLocation point if e. Action = drag action Cancel '' user pressed escape button DragDropInProgressFlag = wrong end if E. Action = drag action No hitTest (new {MyControl1, MyControl2}, MousePointerLocation) then DragDropInProgressFlag = False End If End If End Sub Private Function hitTest (ByVal CTLs () control, ByVal P point as) dim CTLs as Boolean hitTest = in False Point = CTL for each CTL in ClientPoint. Pointtoklint (P) hit Test = Hitstest or (Claintpoint.aks> = 0 and Claintpoint. Y & gt; = 0 and Claintpoint.aks & lt; = c as Tl.Width AndAlso ClientPoint.Y & lt; = ctl.Height) If HitTest again through the pass the next expiration is out of function exit  

HitTest a Raunton which coordinates a mouse status screen (in this example) and array Control and control an array of sifts if the mouse position is any control In verses.


Comments