다음을 통해 공유


GiveFeedbackEventArgs 클래스

정의

끌기 작업 중에 발생하는 GiveFeedback 이벤트에 대한 데이터를 제공합니다.

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

예제

다음 예제에서는 두 ListBox 컨트롤 간의 끌어서 놓기 작업을 보여 줍니다. 이 예제에서는 끌기 작업이 시작될 때 DoDragDrop 메서드를 호출합니다. 마우스가 MouseDown 이벤트 중에 마우스 위치에서 SystemInformation.DragSize 이상 이동한 경우 끌기 작업이 시작됩니다. IndexFromPoint 메서드는 MouseDown 이벤트 중에 끌 항목의 인덱스 확인에 사용됩니다.

또한 이 예제에서는 끌어서 놓기 작업에 사용자 지정 커서를 사용하는 방법을 보여 줍니다. 이 예제에서는 3dwarro.cur3dwno.cur두 개의 커서 파일이 각각 사용자 지정 끌어서 놓기 커서에 대해 애플리케이션 디렉터리에 있다고 가정합니다. UseCustomCursorsCheck CheckBox 선택하면 사용자 지정 커서가 사용됩니다. 사용자 지정 커서는 GiveFeedback 이벤트 처리기에 설정됩니다.

키보드 상태는 오른쪽 ListBox대한 DragOver 이벤트 처리기에서 평가되어 Shift, Ctrl, Alt 또는 Ctrl+Alt 키의 상태에 따라 끌기 작업을 결정합니다. 드롭이 발생하는 ListBox 위치도 DragOver 이벤트 중에 결정됩니다. 삭제할 데이터가 String아닌 경우 DragEventArgs.EffectDragDropEffects.None. 마지막으로 드롭 상태가 DropLocationLabelLabel표시됩니다.

오른쪽 ListBox 대해 삭제할 데이터는 DragDrop 이벤트 처리기에서 결정되며 String 값은 ListBox적절한 위치에 추가됩니다. 끌기 작업이 폼의 범위 밖으로 이동하면 QueryContinueDrag 이벤트 처리기에서 끌어서 놓기 작업이 취소됩니다.

이 코드 발췌에서는 GiveFeedbackEventArgs 클래스를 사용하는 방법을 보여 줍니다. 전체 코드 예제는 DoDragDrop 메서드를 참조하세요.

void ListDragSource_GiveFeedback( Object^ /*sender*/, System::Windows::Forms::GiveFeedbackEventArgs^ e )
{
   // Use custom cursors if the check box is checked.
   if ( UseCustomCursorsCheck->Checked )
   {
      // Sets the custom cursor based upon the effect.
      e->UseDefaultCursors = false;
      if ( (e->Effect & DragDropEffects::Move) == DragDropEffects::Move )
                  ::Cursor::Current = MyNormalCursor;
      else
                  ::Cursor::Current = MyNoDropCursor;
   }
}
private void ListDragSource_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
    // Use custom cursors if the check box is checked.
    if (UseCustomCursorsCheck.Checked)
    {
        // Sets the custom cursor based upon the effect.
        e.UseDefaultCursors = false;
        if ((e.Effect & DragDropEffects.Move) == DragDropEffects.Move)
            Cursor.Current = MyNormalCursor;
        else
            Cursor.Current = MyNoDropCursor;
    }
}
Private Sub ListDragSource_GiveFeedback(ByVal sender As Object, ByVal e As GiveFeedbackEventArgs) Handles ListDragSource.GiveFeedback
    ' Use custom cursors if the check box is checked.
    If (UseCustomCursorsCheck.Checked) Then

        ' Set the custom cursor based upon the effect.
        e.UseDefaultCursors = False
        If ((e.Effect And DragDropEffects.Move) = DragDropEffects.Move) Then
            Cursor.Current = MyNormalCursor
        Else
            Cursor.Current = MyNoDropCursor
        End If
    End If

End Sub

설명

GiveFeedback 이벤트는 끌기 작업 중에 발생합니다. 끌어서 놓기 작업 중에 사용자에게 시각적 피드백을 제공하기 위해 끌기 이벤트의 원본에서 마우스 포인터의 모양을 수정할 수 있습니다. GiveFeedbackEventArgs 개체는 끌어서 놓기 작업의 유형과 기본 커서가 사용되는지 여부를 지정합니다.

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

생성자

GiveFeedbackEventArgs(DragDropEffects, Boolean)

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

GiveFeedbackEventArgs(DragDropEffects, Boolean, Bitmap, Point, Boolean)

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

속성

CursorOffset

끌기 이미지 커서 오프셋을 가져오거나 설정합니다.

DragImage

끌기 이미지 비트맵을 가져오거나 설정합니다.

Effect

표시되는 끌어서 놓기 작업 피드백을 가져옵니다.

UseDefaultCursors

끌기 작업에서 끌어서 놓기 효과와 연결된 기본 커서를 사용해야 하는지 여부를 가져오거나 설정합니다.

UseDefaultDragImage

계층화된 창 끌기 이미지가 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상