System.Windows.Forms.Control.DoDragDrop(object, System.Windows.Forms.DragDropEffects)

Here are the examples of the csharp api class System.Windows.Forms.Control.DoDragDrop(object, System.Windows.Forms.DragDropEffects) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

105 Examples 7

1. Example

Project: sharpgl
Source File: SceneBuilderForm.cs
View license
private void treeViewScene_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
		{
			TreeNode item = (TreeNode)e.Item;

			//	If there's data associated with the item, then drag it.
			if(item.Tag != null)
				DoDragDrop(item, DragDropEffects.Link);		
		}

2. Example

View license
void tvWebElements_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

3. Example

Project: EvilFOCA
Source File: FormMain.cs
View license
private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            (sender as TreeView).SelectedNode = (e.Item as TreeNode);

            if ((e.Item as TreeNode).Tag is IPAddress)
                DoDragDrop((e.Item as TreeNode).Tag, DragDropEffects.Move);
        }

4. Example

View license
protected void onSortableMouseMove(object sender, MouseEventArgs e)
        {
            if((e.Button & MouseButtons.Left) == MouseButtons.Left) {
                if(ddSort.from == -1 || Rows.Count < 1 || Rows[ddSort.from].IsNewRow) {
                    return;
                }
                DoDragDrop(Rows[ddSort.from], DragDropEffects.Move);
            }
        }

5. Example

Project: HourBoostr
Source File: QueueForm.cs
View license
private void lvApps_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Link);
        }

6. Example

View license
private void handleItemDrag(object sender, ItemDragEventArgs e) {
      this.SelectedNode = e.Item as LinkedTreeNode;
      this.DoDragDrop(e.Item, DragDropEffects.All);
    }

7. Example

Project: Graph
Source File: ExampleForm.cs
View license
private void SomeNode_MouseDown(object sender, MouseEventArgs e)
		{
			var node = new Node("Some node");
			node.AddItem(new NodeLabelItem("Entry 1", true, false));
			node.AddItem(new NodeLabelItem("Entry 2", true, false));
			node.AddItem(new NodeLabelItem("Entry 3", false, true));
			node.AddItem(new NodeTextBoxItem("TEXTTEXT", false, true));
			node.AddItem(new NodeDropDownItem(new string[] { "1", "2", "3", "4" }, 0, false, false));
			this.DoDragDrop(node, DragDropEffects.Copy);
		}

8. Example

Project: Graph
Source File: ExampleForm.cs
View license
private void TextureNode_MouseDown(object sender, MouseEventArgs e)
		{
			var textureNode = new Node("Texture");
			textureNode.Location = new Point(300, 150);
			var imageItem = new NodeImageItem(Properties.Resources.example, 64, 64, false, true);
			imageItem.Clicked += new EventHandler<NodeItemEventArgs>(OnImgClicked);
			textureNode.AddItem(imageItem);
			this.DoDragDrop(textureNode, DragDropEffects.Copy);
		}

9. Example

Project: SCMBot
Source File: Main.cs
View license
private void scanListView_ItemDrag(object sender, ItemDragEventArgs e)
        {
           ((ListView)sender).DoDragDrop(((ListView)sender).SelectedItems, DragDropEffects.Move);
        }

10. Example

Project: ME3Explorer
Source File: PackageEditor.cs
View license
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Copy);
        }

11. Example

Project: cardmaker
Source File: MDIProject.cs
View license
private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            var tnSource = e.Item as TreeNode;
            if (tnSource?.Tag != null && tnSource.Tag is ProjectLayout)
            {
                DoDragDrop(e.Item, DragDropEffects.Move);
            }
        }

12. Example

Project: HTML-Renderer
Source File: ControlAdapter.cs
View license
public override void DoDragDropCopy(object dragDropData)
        {
            _control.DoDragDrop(dragDropData, DragDropEffects.Copy);
        }

13. Example

Project: ATF
Source File: ListViewEditor.cs
View license
protected virtual void OnStartDrag(IEnumerable<object> items)
        {
            m_listView.DoDragDrop(items, DragDropEffects.All);
        }

14. Example

Project: Network-Manager
Source File: RouteIPForm.cs
View license
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

15. Example

Project: Network-Manager
Source File: RoutesForm.cs
View license
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

16. Example

Project: Network-Manager
Source File: SaveRouteForm.cs
View license
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

17. Example

Project: nquery
Source File: EvaluatableBrowser.cs
View license
private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
		{
			Binding binding =((TreeNode) e.Item).Tag as Binding;
			if (binding != null)
				DoDragDrop(Identifier.CreateNonVerbatim(binding.Name).ToSource(), DragDropEffects.Copy);
		}

18. Example

Project: FieldLog
Source File: FileTransportView.cs
View license
private void FileDragPictureBox_MouseDown(object sender, MouseEventArgs args)
		{
			object obj = new FileDrop(SharedData.Instance.ArchiveFileName);
			DoDragDrop(obj, DragDropEffects.Copy);
			MainForm.Instance.FinishEnabled = true;
		}

19. Example

Project: FieldLog
Source File: FileTransportView.cs
View license
private void DragInfoLabel_MouseDown(object sender, MouseEventArgs args)
		{
			object obj = new FileDrop(SharedData.Instance.ArchiveFileName);
			DoDragDrop(obj, DragDropEffects.Copy);
			MainForm.Instance.FinishEnabled = true;
		}

20. Example

Project: JSon-Editor
Source File: JsonTreeView.cs
View license
private void ItemDragHandler(object sender, ItemDragEventArgs e)
        {
            var sourceNode = e.Item as JTokenTreeNode;

            if (sourceNode == null)
            {
                return;
            }

            DoDragDrop(e.Item, DragDropEffects.Move | DragDropEffects.Copy);
        }

21. Example

Project: IfcDoc
Source File: FormEdit.cs
View license
private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            TreeNode tn = (TreeNode)e.Item;
            this.DoDragDrop(tn.Tag, DragDropEffects.Move);
        }

22. Example

Project: tcp-gecko-dotnet
Source File: codecontroller.cs
View license
private void codeOutput_ItemDrag(object sender, ItemDragEventArgs e)
        {
            //Begins a drag-and-drop operation in the ListView control.
            codeOutput.DoDragDrop(codeOutput.SelectedItems, DragDropEffects.Move);
        }

23. Example

Project: chummer5a
Source File: frmCreate.cs
View license
private void panContactControl_MouseDown(object sender, MouseEventArgs e)
        {
            Control source = (Control)sender;
            source.DoDragDrop(new TransportWrapper(source), DragDropEffects.Move);
        }

24. Example

Project: chummer5a
Source File: frmCareer.cs
View license
private void panContactControl_MouseDown(object sender, MouseEventArgs e)
        {
            Control source = (Control)sender;
            source.DoDragDrop(new TransportWrapper(source), DragDropEffects.Move);
        }

25. Example

Project: chummer5a
Source File: frmCharacterRoster.cs
View license
private void treCharacterList_ItemDrag(object sender, ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

26. Example

View license
private void TreeViewItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Move);
        }

27. Example

Project: hakchi2
Source File: FoldersManagerForm.cs
View license
private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            if ((e.Button == MouseButtons.Left) && !((e.Item as TreeNode).Tag is NesMenuCollection)) // We can't drag root
                DoDragDrop(new TreeNode[] { (TreeNode)e.Item }, DragDropEffects.Move);
        }

28. Example

View license
protected override void OnItemDrag(ItemDragEventArgs e)
		{
			base.OnItemDrag(e);
			if (AllowRowReorder)
				base.DoDragDrop(e.Item, DragDropEffects.Move);
		}

29. Example

Project: sharpgl
Source File: PolygonBuilder.cs
View license
private void listViewVertices_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if(listViewVertices.Items.Count == 0)
				return;
    
			//	Get the item at the point clicked.
			ListViewItem item = listViewVertices.GetItemAt(e.X, e.Y);

			if(item != null)
			{

				//	Start dragging and dropping.
				DragDropEffects effects = DoDragDrop(item.Text, DragDropEffects.Copy);
			}
		}

30. Example

Project: tesvsnip
Source File: ObjectListView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            base.OnItemDrag(e);

            if (DragSource == null)
                return;

            Object data = DragSource.StartDrag(this, e.Button, (OLVListItem) e.Item);
            if (data != null)
            {
                DragDropEffects effect = DoDragDrop(data, DragSource.GetAllowedEffects(data));
                DragSource.EndDrag(data, effect);
            }
        }

31. Example

Project: falloutsnip
Source File: ObjectListView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            base.OnItemDrag(e);

            if (DragSource == null)
                return;

            Object data = DragSource.StartDrag(this, e.Button, (OLVListItem) e.Item);
            if (data != null)
            {
                DragDropEffects effect = DoDragDrop(data, DragSource.GetAllowedEffects(data));
                DragSource.EndDrag(data, effect);
            }
        }

32. Example

Project: Toxy
Source File: MyListView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            base.OnItemDrag(e);

            if (AllowDrop && AllowItemDrag && e.Button == MouseButtons.Left)
            {
                DoDragDrop(e.Item, DragDropEffects.Move);
            }
        }

33. Example

Project: KeeThief
Source File: MainForm.cs
View license
private void OnPwListItemDrag(object sender, ItemDragEventArgs e)
		{
			if(e.Item == null) return;
			PwListItem pli = (((ListViewItem)e.Item).Tag as PwListItem);
			if(pli == null) { Debug.Assert(false); return; }
			PwEntry pe = pli.Entry;

			ListViewHitTestInfo lvHit = m_lvEntries.HitTest(m_ptLastEntriesMouseClick);
			ListViewItem lvi = lvHit.Item;
			if(lvi == null) return;

			string strText = string.Empty;

			if(!AppPolicy.Current.DragDrop)
				strText = AppPolicy.RequiredPolicyMessage(AppPolicyId.DragDrop);
			else
			{
				int i = 0;
				foreach(ListViewItem.ListViewSubItem lvs in lvi.SubItems)
				{
					if(lvs == lvHit.SubItem)
					{
						bool bDummy;
						strText = GetEntryFieldEx(pe, i, false, out bDummy);
						break;
					}

					++i;
				}
			}

			PwDatabase pd = m_docMgr.SafeFindContainerOf(pe);
			string strToTransfer = SprEngine.Compile(strText, new SprContext(
				pe, pd, SprCompileFlags.All));

			m_pgActiveAtDragStart = GetSelectedGroup();

			m_bDraggingEntries = true;
			this.DoDragDrop(strToTransfer, DragDropEffects.Copy | DragDropEffects.Move);
			m_bDraggingEntries = false;

			pe.Touch(false);
			UpdateUIState(false); // SprEngine.Compile might have modified the database
		}

34. Example

Project: KeeThief
Source File: MainForm.cs
View license
private void OnGroupsListItemDrag(object sender, ItemDragEventArgs e)
		{
			TreeNode tn = (e.Item as TreeNode);
			if(tn == null) { Debug.Assert(false); return; }

			PwGroup pg = (tn.Tag as PwGroup);
			if(pg == null) { Debug.Assert(false); return; }

			if(pg == m_docMgr.ActiveDatabase.RootGroup) return;
			if(pg.ParentGroup == null) return;

			m_pgActiveAtDragStart = pg;
			this.DoDragDrop(pg, DragDropEffects.Copy | DragDropEffects.Move);
			pg.Touch(false);
		}

35. Example

View license
protected override void OnItemDrag(ItemDragEventArgs e)
    {
      base.OnItemDrag(e);

      if (DragAndDropEnabled)
      {
          IsUpdating = true;
          DoDragDrop(SelectedItems, DragDropEffects.Move);
          IsUpdating = false;
      }
    }

36. Example

View license
protected override void OnMouseMove (MouseEventArgs e)
    {
      if (e.Button == MouseButtons.Left && _draggedTab != null)
        DoDragDrop (_draggedTab, DragDropEffects.Move);

      base.OnMouseMove (e);
    }

37. Example

Project: logwizard
Source File: ObjectListView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e) {
            base.OnItemDrag(e);

            if (this.DragSource == null)
                return;

            Object data = this.DragSource.StartDrag(this, e.Button, (OLVListItem)e.Item);
            if (data != null) {
                DragDropEffects effect = this.DoDragDrop(data, this.DragSource.GetAllowedEffects(data));
                this.DragSource.EndDrag(data, effect);
            }
        }

38. Example

View license
protected override void OnItemDrag(ItemDragEventArgs e) {
            base.OnItemDrag(e);

            if (this.DragSource == null)
                return;

            Object data = this.DragSource.StartDrag(this, e.Button, (OLVListItem)e.Item);
            if (data != null) {
                DragDropEffects effect = this.DoDragDrop(data, this.DragSource.GetAllowedEffects(data));
                this.DragSource.EndDrag(data, effect);
            }
        }

39. Example

Project: MvvmFx
Source File: BoundTreeView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Copy | DragDropEffects.Move); //Begin the drag-drop operation
            base.OnItemDrag(e);
        }

40. Example

Project: MvvmFx
Source File: BoundTreeView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Copy | DragDropEffects.Move); //Begin the drag-drop operation
            base.OnItemDrag(e);
        }

41. Example

Project: MvvmFx
Source File: BoundTreeView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Copy | DragDropEffects.Move); //Begin the drag-drop operation
            base.OnItemDrag(e);
        }

42. Example

Project: MvvmFx
Source File: BoundTreeView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            DoDragDrop(e.Item, DragDropEffects.Copy | DragDropEffects.Move); //Begin the drag-drop operation
            base.OnItemDrag(e);
        }

43. Example

Project: Outliner-3.0
Source File: TreeView.cs
View license
protected override void OnMouseMove(MouseEventArgs e)
   {
      if (e == null || this.TreeNodeLayout == null)
         return;

      Boolean isDragDropMouseButton = (e.Button & this.Settings.DragDropMouseButton) == this.Settings.DragDropMouseButton;
      if (!isDragDropMouseButton)
      {
         this.isDragging = false;
         this.dragStartPos = Point.Empty;
      }

      TreeNode tn = this.GetNodeAt(e.Location);

      //Start dragging.
      if (tn != null && !this.isDragging
          && isDragDropMouseButton
          && ControlHelpers.Distance(e.Location, this.dragStartPos) > 5
          && this.selectedNodes.Count > 0)
      {
         this.isDragging = true;
         if (tn.DragDropHandler != null && tn.DragDropHandler.AllowDrag)
         {
            DataObject data = new DataObject( typeof(IEnumerable<TreeNode>).FullName
                                            , this.selectedNodes);
            this.DoDragDrop(data, TreeView.AllowedDragDropEffects);
         }
      }
      else
         this.TreeNodeLayout.HandleMouseMove(e, tn);
   }

44. Example

Project: MailSystem.NET
Source File: FolderView.cs
View license
private void folderTreeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            if (e.Item is TreeNode && ((TreeNode)e.Item).ImageKey.Equals("Folder.bmp"))
            {
                DoDragDrop(e.Item, DragDropEffects.Move);
            }
        }

45. Example

Project: poderosa
Source File: TabBar.cs
View license
public void StartDrag(TabBarButton btn) {
            _draggingButton = btn;
            btn.ParentTabBar.ParentTable.OnStartButtonDragByUI(_draggingButton.TabKey);

            //DoDragDrop??????????????Query?????????
            btn.ParentTabBar.DoDragDrop("poderosa.tabkey", DragDropEffects.Move | DragDropEffects.Link); //TODO ?????????
        }

46. Example

Project: PowerPointLabs
Source File: ColorPane.cs
View license
private void StartDragDrop(object sender)
        {
            DataObject colorObject = new DataObject();
            colorObject.SetData(((Panel)sender).BackColor);
            DoDragDrop(colorObject, DragDropEffects.All);
        }

47. Example

Project: JabberNet-2010
Source File: RosterTree.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            base.OnItemDrag(e);

            if (e.Item is ItemNode)
                this.DoDragDrop(e.Item, DragDropEffects.Move);
        }

48. Example

Project: ShareX
Source File: MyListView.cs
View license
protected override void OnItemDrag(ItemDragEventArgs e)
        {
            base.OnItemDrag(e);

            if (AllowDrop && AllowItemDrag && e.Button == MouseButtons.Left)
            {
                DoDragDrop(e.Item, DragDropEffects.Move);
            }
        }

49. Example

Project: MailSystem.NET
Source File: FolderView.cs
View license
private void folderTreeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            if (e.Item is TreeNode && ((TreeNode)e.Item).ImageKey.Equals("Folder.bmp"))
            {
                DoDragDrop(e.Item, DragDropEffects.Move);
            }
        }

50. Example

Project: OrionSDK
Source File: ObjectExplorer.cs
View license
private void TreeMouseMove(object sender, MouseEventArgs e)
        {
            const int diff = 10;
            if (_dragNode != null && !_isDragging && ((Math.Abs(_lastLocation.X - e.Location.X) >= diff) || (Math.Abs(_lastLocation.Y - e.Location.Y) >= diff)))
            {
                _isDragging = true;
                _tree.DoDragDrop(_dragNode.Tag, DragDropEffects.Copy);
                _dragNode = null;
            }
        }