C#, introduce a DragOver delay

Posted by user275587 on Stack Overflow See other posts from Stack Overflow or by user275587
Published on 2010-05-30T20:22:58Z Indexed on 2010/05/30 20:32 UTC
Read the original article Hit count: 279

Filed under:
|
|
|
|

In my application I catch a DragOver event and then perform an action. I'd like to wait for half a second before performing the action, the action should not be performed after that delay if the drag operation has ended.

The only way I could think of to implement this feature is something like this:

Function DragOver Event
   If TimerTimeReached Then
      PerformDragAction
   Else If Not TimerStarted
      StartTimer
   End
End Function  

Function DragLeave Event
   If TimerStarted
      StopTimer
   End
End Function

Is there a better way to perform this operation?

© Stack Overflow or respective owner

Related posts about c#

Related posts about drag