QueryContinueDragEventArgs QueryContinueDragEventArgs QueryContinueDragEventArgs QueryContinueDragEventArgs Class

정의

QueryContinueDrag 이벤트에 대한 데이터를 제공합니다.Provides data for the QueryContinueDrag event.

public ref class QueryContinueDragEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class QueryContinueDragEventArgs : EventArgs
type QueryContinueDragEventArgs = class
    inherit EventArgs
Public Class QueryContinueDragEventArgs
Inherits EventArgs
상속
QueryContinueDragEventArgsQueryContinueDragEventArgsQueryContinueDragEventArgsQueryContinueDragEventArgs
특성

예제

이 코드 예제를 사용 하 여 보여 줍니다.는 QueryContinueDragEventArgs 클래스는 QueryContinueDrag 이벤트입니다.This code excerpt demonstrates using the QueryContinueDragEventArgs class with the QueryContinueDrag event. 참조 된 DoDragDrop 전체 코드 예제에 대 한 메서드.See the DoDragDrop method for the complete code example.

void ListDragSource_QueryContinueDrag( Object^ sender, System::Windows::Forms::QueryContinueDragEventArgs^ e )
{
   // Cancel the drag if the mouse moves off the form.
   ListBox^ lb = dynamic_cast<ListBox^>(sender);
   if ( lb != nullptr )
   {
      Form^ f = lb->FindForm();

      // Cancel the drag if the mouse moves off the form. The screenOffset
      // takes into account any desktop bands that may be at the top or left
      // side of the screen.
      if ( ((Control::MousePosition.X - screenOffset.X) < f->DesktopBounds.Left) || ((Control::MousePosition.X - screenOffset.X) > f->DesktopBounds.Right) || ((Control::MousePosition.Y - screenOffset.Y) < f->DesktopBounds.Top) || ((Control::MousePosition.Y - screenOffset.Y) > f->DesktopBounds.Bottom) )
      {
         e->Action = DragAction::Cancel;
      }
   }
}
private void ListDragSource_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e) {
    // Cancel the drag if the mouse moves off the form.
    ListBox lb = sender as ListBox;

    if (lb != null) {

        Form f = lb.FindForm();

        // Cancel the drag if the mouse moves off the form. The screenOffset
        // takes into account any desktop bands that may be at the top or left
        // side of the screen.
        if (((Control.MousePosition.X - screenOffset.X) < f.DesktopBounds.Left) ||
            ((Control.MousePosition.X - screenOffset.X) > f.DesktopBounds.Right) ||
            ((Control.MousePosition.Y - screenOffset.Y) < f.DesktopBounds.Top) ||
            ((Control.MousePosition.Y - screenOffset.Y) > f.DesktopBounds.Bottom)) {

            e.Action = DragAction.Cancel;
        }
    }
}
Private Sub ListDragSource_QueryContinueDrag(ByVal sender As Object, ByVal e As QueryContinueDragEventArgs) Handles ListDragSource.QueryContinueDrag
    ' Cancel the drag if the mouse moves off the form.
    Dim lb as ListBox = CType(sender, System.Windows.Forms.ListBox)

    If (lb isNot nothing) Then

        Dim f as Form = lb.FindForm()

        ' Cancel the drag if the mouse moves off the form. The screenOffset
        ' takes into account any desktop bands that may be at the top or left
        ' side of the screen.
        If (((Control.MousePosition.X - screenOffset.X) < f.DesktopBounds.Left) Or _
            ((Control.MousePosition.X - screenOffset.X) > f.DesktopBounds.Right) Or _
            ((Control.MousePosition.Y - screenOffset.Y) < f.DesktopBounds.Top) Or _
            ((Control.MousePosition.Y - screenOffset.Y) > f.DesktopBounds.Bottom)) Then

            e.Action = DragAction.Cancel
        End If
    End if
End Sub

설명

QueryContinueDrag 이벤트 끌어서 놓기 작업 중에 발생 하 고 끌기 소스가 끌어서 놓기 작업을 취소 해야 하는지 여부를 결정할 수 있습니다.The QueryContinueDrag event occurs during a drag-and-drop operation and allows the drag source to determine whether the drag-and-drop operation should be canceled. QueryContinueDragEventArgs 끌어서 놓기 작업을 계속할지 여부 및 방법을, 보조키를 눌렀는지 여부 및 사용자가 ESC 키를 눌렀습니다 여부를 지정 합니다.A QueryContinueDragEventArgs specifies whether and how the drag-and-drop operation should proceed, whether any modifier keys are pressed, and whether the user has pressed the ESC key.

기본적으로 Esc 키를 누른 경우 QueryContinueDrag 이벤트는 ActionDragAction.Cancel로 설정하고 마우스 왼쪽, 가운데 또는 오른쪽 단추를 누른 경우 ActionDragAction.Drop으로 설정합니다.By default, the QueryContinueDrag 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.

이벤트 모델에 대 한 자세한 내용은 이벤트 처리 및 발생합니다.For information about the event model, see Handling and Raising Events.

생성자

QueryContinueDragEventArgs(Int32, Boolean, DragAction) QueryContinueDragEventArgs(Int32, Boolean, DragAction) QueryContinueDragEventArgs(Int32, Boolean, DragAction) QueryContinueDragEventArgs(Int32, Boolean, DragAction)

QueryContinueDragEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the QueryContinueDragEventArgs class.

속성

Action Action Action Action

끌어서 놓기 작업의 상태를 가져오거나 설정합니다.Gets or sets the status of a drag-and-drop operation.

EscapePressed EscapePressed EscapePressed EscapePressed

사용자가 Esc 키를 눌렀는지 여부를 나타내는 값을 가져옵니다.Gets whether the user pressed the ESC key.

KeyState KeyState KeyState KeyState

Shift, Ctrl 및 Alt 키의 현재 상태를 가져옵니다.Gets the current state of the SHIFT, CTRL, and ALT keys.

메서드

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

적용 대상

추가 정보