QueryContinueDragEventArgs 클래스

정의

QueryContinueDrag 이벤트에 대한 데이터를 제공합니다.

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

예제

이 코드 발췌에서는 클래스를 QueryContinueDragEventArgs 이벤트와 함께 사용하는 방법을 보여 줍니다 QueryContinueDrag . 참조 된 DoDragDrop 전체 코드 예제에 대 한 메서드.

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, 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, 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 이벤트 끌어서 놓기 작업 중에 발생 하 고 끌기 소스가 끌어서 놓기 작업을 취소 해야 하는지 여부를 결정할 수 있습니다. 은 QueryContinueDragEventArgs 끌어서 놓기 작업을 진행할지 여부와 방법, 한정자 키를 누를지 여부 및 사용자가 ESC 키를 누른지 여부를 지정합니다.

기본적으로 Esc 키를 누른 경우 QueryContinueDrag 이벤트는 ActionDragAction.Cancel로 설정하고 마우스 왼쪽, 가운데 또는 오른쪽 단추를 누른 경우 ActionDragAction.Drop으로 설정합니다.

이벤트 모델에 대 한 자세한 내용은 이벤트 처리 및 발생합니다.

생성자

QueryContinueDragEventArgs(Int32, Boolean, DragAction)

QueryContinueDragEventArgs 클래스의 새 인스턴스를 초기화합니다.

속성

Action

끌어서 놓기 작업의 상태를 가져오거나 설정합니다.

EscapePressed

사용자가 Esc 키를 눌렀는지 여부를 나타내는 값을 가져옵니다.

KeyState

Shift, Ctrl 및 Alt 키의 현재 상태를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보