I have a drag-and-drop functionality in my application using DragDrop event and DoDragDrop method to start dragging. The question is: how can I capture cancelling dragging when Esc is pressed during the p开发者_JAVA百科rocess of dragging?
That's what the QueryContinueDrag event is designed to do. It is raised on the drag source when the user presses the Escape key, the e.EscapePressed property will be true. Set e.Action = DragAction.Cancel to cancel the D+D.
精彩评论