private void PhotoStartDrag(object sender, ItemDragEventArgs e) { if (sender == lvPics) { lvPics.DoDragDrop(e.Item, DragDropEffects.Move); } }
private void lstColumns_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (lstColumns.SelectedItems.Count > 0) { string text = lstColumns.SelectedItems[0].Text; lstColumns.DoDragDrop(text, DragDropEffects.Copy | DragDropEffects.Move); } }
private void lstIssues_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { // ListViewItem itemSelected = lstIssues.SelectedItems[0]; // // lstIssues.DoDragDrop( itemSelected.SubItems[0].Text, // System.Windows.Forms.DragDropEffects.Copy ); if (lstIssues.SelectedItems.Count > 0) { ListViewItem itemSelected = lstIssues.SelectedItems[0]; lstIssues.DoDragDrop(itemSelected.SubItems[0].Text, System.Windows.Forms.DragDropEffects.Copy); } return; }
private void listView1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { ListViewItem dragedLvi = (ListViewItem)e.Item; if (DragDropEffects.Move == listView1.DoDragDrop(dragedLvi, DragDropEffects.Move)) { listView1.Items.Remove(dragedLvi); } }
private void ItemsLV_MouseMove(object sender, MouseEventArgs e) { if (m_enableDragging && e.Button == MouseButtons.Left && !m_dragPosition.Equals(e.Location)) { object data = GetDataToDrag(); if (data != null) { ItemsLV.DoDragDrop(data, DragDropEffects.Copy); } } }
private void listView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) { if (dragBoxFromMouseDown != Rectangle.Empty && !dragBoxFromMouseDown.Contains(e.X, e.Y)) { screenOffset = SystemInformation.WorkingArea.Location; DragDropEffects dropEffect = listView1.DoDragDrop(listView1.SelectedItems[0], DragDropEffects.Move); } } }
private void LibraryListView_ItemDrag(object sender, ItemDragEventArgs e) { ArrayList items = new ArrayList(); foreach (ListViewItem item in LibraryListView.SelectedItems) { string fullname = GetItemFullName(item); items.Add(fullname); } DataObject data = new DataObject("LibraryListItems", items); LibraryListView.DoDragDrop(data, DragDropEffects.All); }
private void LocalView_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button != 0) { string msg = ""; for (int i = 0; i < LocalView.SelectedItems.Count; i++) { msg += LocalView.SelectedItems[i].Text + "\n"; } LocalView.DoDragDrop(msg, DragDropEffects.Copy | DragDropEffects.Move); } }
private void listView_ItemDrag(object sender, ItemDragEventArgs e) { ListView listView = sender as ListView; if (listView == null) return; if (listView == lvDisplayedColumns && listView.SelectedItems.Contains(lvDisplayedColumns.Items[0])) { MessageBox.Show(this, string.Format("The \"{0}\" column can't be moved!", ((ColumnData)lvDisplayedColumns.Items[0].Tag).Header)); return; } mDragStartListView = listView; mDragStartListView.DoDragDrop(listView.SelectedItems, DragDropEffects.Move | DragDropEffects.Copy); }
TreeNode previousSelected = null; //Save previous selected node in DragDrop for Delete old node private void listView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) { if (listView1.SelectedIndices.Count == 0) { return; } int index = listView1.SelectedIndices[0]; AIONode node = (AIONode)listView1.Items[index].Tag; //Copy or Move listView1.DoDragDrop(node, DragDropEffects.All); } }
private void MylistView_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { int count = m_listView.SelectedItems.Count; string[] s = new string[count]; int i = 0; foreach (ListViewItem x in m_listView.SelectedItems) { s[i++] = System.IO.Path.Combine(x.SubItems[1].Text, x.Text); } DataObject d = new DataObject(); d.SetData(DataFormats.FileDrop, s); m_listView.DoDragDrop(d, DragDropEffects.Copy); }
private void messagesListView_MouseMove(object sender, MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left) { // If the mouse moves outside the rectangle, start the drag. if (_dragBoxFromMouseDown != Rectangle.Empty && !_dragBoxFromMouseDown.Contains(e.X, e.Y)) { System.Messaging.Message[] messages = new System.Messaging.Message[messagesListView.SelectedItems.Count]; for (int i = 0; i < messagesListView.SelectedItems.Count; i++) { messages[i] = ((MessageListViewItem)messagesListView.SelectedItems[i]).Message; } MessageDragContainer messageDragContainer = new MessageDragContainer(_qSetQueueItem, messages); messagesListView.DoDragDrop(messageDragContainer, DragDropEffects.Move); } } }
private void listView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left && (Math.Abs(e.X) >= 4 || Math.Abs(e.Y) >= 4)) { if (listView1.SelectedItems.Count == 1) { ButtonItem item = new ButtonItem("dragitem", listView1.SelectedItems[0].Text); item.ImageIndex = listView1.SelectedItems[0].ImageIndex; item.ButtonStyle = eButtonStyle.ImageAndText; item.ImagePosition = eImagePosition.Top; m_InternalDragDrop = true; if (listView1.DoDragDrop(item, DragDropEffects.All) == DragDropEffects.Move) { listView1.Items.Remove(listView1.SelectedItems[0]); } m_InternalDragDrop = false; } } }
private TreeNode previousSelected = null; //Save previous selected node in DragDrop for Delete old node private void listView1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if ((e.Button & MouseButtons.Left) == MouseButtons.Left && !IsDragDroping) { if (listView1.SelectedIndices.Count == 0) { return; } //int index = listView1.SelectedIndices[0]; //AIONode node = (AIONode)listView1.Items[index].Tag; AIONode [] nodes = GetOperateNode(listView1); IsDragDroping = true; //ddType = DragDropType.LIST; previousSelected = treeView1.SelectedNode; //Copy or Move listView1.DoDragDrop(nodes, DragDropEffects.Copy | DragDropEffects.Move); } }
private void mediaListView_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right) { if (dragStartPoint.X != e.X || dragStartPoint.Y != e.Y) { ArrayList mediaList = new ArrayList(); foreach (ListViewItem i in mediaListView.SelectedItems) { if (i.Tag.GetType() == typeof(CpMediaItem)) { mediaList.Add((CpMediaItem)i.Tag); } } if (mediaList.Count > 0) { CpMediaItem[] mediaArray = (CpMediaItem[])mediaList.ToArray(typeof(CpMediaItem)); mediaListView.DoDragDrop(mediaArray, DragDropEffects.Copy | DragDropEffects.Move); } } } }
public void ItemDragTest () { Form myform = new Form (); myform.ShowInTaskbar = false; ListView mylistview = new ListView (); mylistview.ItemDrag += new ItemDragEventHandler (ItemDragEventHandler); mylistview.View = View.Details; mylistview.SetBounds (10, 10, 200, 200, BoundsSpecified.All); mylistview.Columns.Add ("A", -2, HorizontalAlignment.Center); mylistview.Columns.Add ("B", -2, HorizontalAlignment.Center); ListViewItem item1 = new ListViewItem ("A", -1); mylistview.Items.Add (item1); myform.Controls.Add (mylistview); myform.ShowDialog (); mylistview.Visible = true; mylistview.DoDragDrop (mylistview.SelectedItems, DragDropEffects.Link); Assert.AreEqual (true, eventhandled, "#A7"); myform.Dispose (); }
private void list_ItemDrag(object sender, ItemDragEventArgs e) { //Begins a drag-and-drop operation in the ListView control. list.DoDragDrop(list.SelectedItems, DragDropEffects.Move); }
private void lstBrowser_ItemDrag(object sender, ItemDragEventArgs e) { lstBrowser.DoDragDrop(lstBrowser.SelectedItems[0], DragDropEffects.All); }
private void m_lvClassificacao_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { m_lvClassificacao.DoDragDrop(m_lvClassificacao, System.Windows.Forms.DragDropEffects.Copy); }
private void ListView_ItemDrag(object sender, ItemDragEventArgs e) { _dragSource = sender as ListView; if (_dragSource != null) _dragSource.DoDragDrop(_dragSource.SelectedItems, DragDropEffects.Move); }
private void MovieRentalStartDrag(object sender, ItemDragEventArgs e) { lstRentals.DoDragDrop(e.Item, DragDropEffects.Move); }