QueryContinueDragEventArgs 클래스

정의

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

public ref class QueryContinueDragEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class QueryContinueDragEventArgs : EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
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 이벤트는 끌어서 놓기 작업 중에 발생하며 끌기 소스에서 끌어서 놓기 작업을 취소해야 하는지 여부를 결정할 수 있습니다. A는 QueryContinueDragEventArgs 끌어서 놓기 작업을 진행할지 여부와 방법, 한정자 키를 누를지 여부 및 사용자가 ESC 키를 눌렀는지 여부를 지정합니다.

기본적으로 QueryContinueDrag 이벤트는 ESC 키를 누른 경우로 DragAction.Cancel 설정하고 Action 왼쪽, 가운데 또는 오른쪽 마우스 단추를 누르면 설정 DragAction.DropAction 됩니다.

이벤트 모델에 대한 자세한 내용은 이벤트 처리 및 발생을 참조하세요.

생성자

Name Description
QueryContinueDragEventArgs(Int32, Boolean, DragAction)

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

속성

Name Description
Action

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

EscapePressed

사용자가 ESC 키를 눌렀는지 여부를 가져옵니다.

KeyState

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

메서드

Name Description
Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상

추가 정보