This documentation is archived and is not being maintained.
DragDrop Class
Visual Studio 2008
Provides helper methods and fields for initiating drag-and-drop operations, including a method to begin a drag-and-drop operation, and facilities for adding and removing drag-and-drop related event handlers.
Assembly: PresentationCore (in PresentationCore.dll)
The following example demonstrates how to use a DragDrop object.
Private Sub DragStarted() m_IsDown = False Dim serializedObject As String = m_OriginalElement.OuterXml Dim data As DataObject = New DataObject() data.SetData(m_MyFormat.Name, serializedObject) Dim effects As DragDropEffects = _ DragDrop.DoDragDrop(MyCanvas, data, DragDropEffects.Copy Or DragDropEffects.Move) If effects And DragDropEffects.Move Then ' Remove the element. m_OriginalElement.ParentNode.RemoveChild(m_OriginalElement) m_OriginalElement = Nothing End If End Sub
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: