編集

次の方法で共有


WorkflowView.OnQueryContinueDrag(QueryContinueDragEventArgs) Method

Definition

Occurs during a drag operation and allows the drag source to determine whether the drag option should be canceled.

protected:
 override void OnQueryContinueDrag(System::Windows::Forms::QueryContinueDragEventArgs ^ qcdevent);
protected override void OnQueryContinueDrag (System.Windows.Forms.QueryContinueDragEventArgs qcdevent);
override this.OnQueryContinueDrag : System.Windows.Forms.QueryContinueDragEventArgs -> unit
Protected Overrides Sub OnQueryContinueDrag (qcdevent As QueryContinueDragEventArgs)

Parameters

qcdevent
QueryContinueDragEventArgs

A QueryContinueDragEventArgs that contains information about the event.

Remarks

The OnQueryContinueDrag event is raised when there is a change in the keyboard or mouse button state during a drag operation. The OnQueryContinueDrag event allows the drag source to determine whether the drag operation should be canceled.

Events related to drag operations are raised when the control is a valid drop target. The OnGiveFeedback event is raised with the drag effect specified. For a list of drag effects, see the DragDropEffects enumeration.

Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.

  • If the user moves out of a window, the OnDragLeave event is raised.

  • If the mouse enters another control, the OnDragEnter for that control is raised.

  • If the mouse moves but stays within the same control, the OnDragOver event is raised.

If there is a change in the keyboard or mouse button state, the OnQueryContinueDrag 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 QueryContinueDragEventArgs.

If the value is DragAction.Continue, the OnDragOver event is raised to continue the operation and the OnGiveFeedback 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.

Note

The OnDragOver and OnGiveFeedback events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse position.

If the value is DragAction.Drop, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.

If the value is DragAction.Cancel, the OnDragLeave event is raised.

By default, the OnQueryContinueDrag event sets Action to DragAction.Cancel if the ESC key was pressed and sets Action to DragAction.Drop if the left, middle, or right mouse button is pressed.

Applies to