ItemDragEventArgs ItemDragEventArgs ItemDragEventArgs ItemDragEventArgs Class

정의

ItemDragListView 컨트롤의 TreeView 이벤트에 대한 데이터를 제공합니다.Provides data for the ItemDrag event of the ListView and TreeView controls.

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

예제

다음 예제에서는의 사용을 보여 줍니다 ItemDragEventArgs 내에서 끌어서 놓기 작업을 사용 하도록 설정할 때를 TreeView입니다.The following example illustrates the use of ItemDragEventArgs when enabling drag-and-drop operations within a TreeView. Button 노드가 이동 하거나 해당 대상에 복사 속성을 결정 합니다.The Button property determines whether the dragged node should be moved or copied to its destination. 노드를 나타내는 합니다 Item 속성에 전달 됩니다는 TreeView 컨트롤의 DoDragDrop 원하는 효과 나타내는 값을 함께 메서드.The node, represented by the Item property, is then passed to the TreeView control's DoDragDrop method along with a value indicating the desired effect.

전체 예제를 참조 하세요.를 TreeView.ItemDrag 참조 항목입니다.For the complete example, see the TreeView.ItemDrag reference topic.

private:
   void treeView1_ItemDrag( Object^ /*sender*/, ItemDragEventArgs^ e )
   {
      
      // Move the dragged node when the left mouse button is used.
      if ( e->Button == ::MouseButtons::Left )
      {
         DoDragDrop( e->Item, DragDropEffects::Move );
      }
      // Copy the dragged node when the right mouse button is used.
      else
      
      // Copy the dragged node when the right mouse button is used.
      if ( e->Button == ::MouseButtons::Right )
      {
         DoDragDrop( e->Item, DragDropEffects::Copy );
      }
   }
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
{
    // Move the dragged node when the left mouse button is used.
    if (e.Button == MouseButtons.Left)
    {
        DoDragDrop(e.Item, DragDropEffects.Move);
    }

    // Copy the dragged node when the right mouse button is used.
    else if (e.Button == MouseButtons.Right)
    {
        DoDragDrop(e.Item, DragDropEffects.Copy);
    }
}
Private Sub treeView1_ItemDrag(ByVal sender As Object, ByVal e As ItemDragEventArgs)

    ' Move the dragged node when the left mouse button is used.
    If e.Button = MouseButtons.Left Then
        DoDragDrop(e.Item, DragDropEffects.Move)

    ' Copy the dragged node when the right mouse button is used.
    ElseIf e.Button = MouseButtons.Right Then
        DoDragDrop(e.Item, DragDropEffects.Copy)
    End If
End Sub

설명

ItemDrag 이벤트 항목을 끌기 시작할 때 발생 합니다.The ItemDrag event occurs when the user begins dragging an item. ItemDragEventArgs 개체 누른 마우스 단추를 지정 합니다.An ItemDragEventArgs object specifies which mouse button was pressed.

생성자

ItemDragEventArgs(MouseButtons) ItemDragEventArgs(MouseButtons) ItemDragEventArgs(MouseButtons) ItemDragEventArgs(MouseButtons)

지정된 마우스 단추를 사용하여 ItemDragEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ItemDragEventArgs class with a specified mouse button.

ItemDragEventArgs(MouseButtons, Object) ItemDragEventArgs(MouseButtons, Object) ItemDragEventArgs(MouseButtons, Object) ItemDragEventArgs(MouseButtons, Object)

지정된 마우스 단추 및 끌고 있는 항목을 사용하여 ItemDragEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ItemDragEventArgs class with a specified mouse button and the item that is being dragged.

속성

Button Button Button Button

끌기 작업 동안 어떤 마우스 단추를 눌렀는지를 나타내는 값을 가져옵니다.Gets a value that indicates which mouse buttons were pressed during the drag operation.

Item Item Item Item

끌고 있는 항목을 가져옵니다.Gets the item that is being dragged.

메서드

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)

적용 대상