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 끌기 작업이 시작 될 때 메서드. 마우스를 이동 하는 경우 끌기 작업이 시작 둘 SystemInformation.DragSize 하는 동안 마우스 위치에서의 MouseDown 이벤트입니다. 합니다 IndexFromPoint 메서드를 사용 하는 동안 끌어서 항목의 인덱스를 확인 합니다 MouseDown 이벤트입니다.

또한이 사용자 지정 커서를 사용 하 여 끌어서 놓기 작업에 대 한 예제입니다. 이 예제에서는 두 개의 가정 커서 파일인 3dwarro.cur3dwno.cur, 사용자 지정 끌기에 대 한 애플리케이션 디렉터리에 있으며 놓기 없음 커서를 각각. 사용자 지정 커서를 사용할 경우는 UseCustomCursorsCheckCheckBox 확인란이 선택 되어 있습니다. 에 설정 된 사용자 지정 커서를 GiveFeedback 이벤트 처리기입니다.

키보드 상태에서 평가 되는 DragOver 오른쪽에 대 한 이벤트 처리기 ListBox결정 끌기 작업을 SHIFT, CTRL, ALT 또는 CTRL + ALT 키의 상태에 따라 합니다. 위치는 ListBox 하는 동안 결정 됩니다 드롭다운 수행 되는 DragOver 이벤트입니다. 데이터 삭제 없는 경우는 String, 해당 DragEventArgs.Effect 로 설정 된 DragDropEffects.None합니다. 드롭다운의 상태에 표시 됩니다는 마지막으로, 합니다 DropLocationLabelLabel합니다.

데이터를 오른쪽에 대 한 drop 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)

적용 대상