コード例 #1
0
 private void PhotoStartDrag(object sender, ItemDragEventArgs e)
 {
     if (sender == lvPics)
     {
         lvPics.DoDragDrop(e.Item, DragDropEffects.Move);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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;
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
ファイル: BaseListCtrl.cs プロジェクト: neobox3000/UA-.NET
        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);
                }
            }
        }
コード例 #6
0
ファイル: UserManager.cs プロジェクト: 15831944/gpython
 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);
         }
     }
 }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
            }
        }
コード例 #11
0
        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);
        }
コード例 #12
0
ファイル: MessageBrowser.cs プロジェクト: dextergithub/QSet
 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);
         }
     }
 }
コード例 #13
0
ファイル: form1.cs プロジェクト: xy19xiaoyu/DotNetBar2Demos
 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;
         }
     }
 }
コード例 #14
0
        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);
             }
         }
     }
 }
コード例 #16
0
		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 ();
		}
コード例 #17
0
 private void list_ItemDrag(object sender, ItemDragEventArgs e)
 {
     //Begins a drag-and-drop operation in the ListView control.
     list.DoDragDrop(list.SelectedItems, DragDropEffects.Move);
 }
コード例 #18
0
 private void lstBrowser_ItemDrag(object sender, ItemDragEventArgs e)
 {
     lstBrowser.DoDragDrop(lstBrowser.SelectedItems[0], DragDropEffects.All);
 }
コード例 #19
0
 private void m_lvClassificacao_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
 {
     m_lvClassificacao.DoDragDrop(m_lvClassificacao, System.Windows.Forms.DragDropEffects.Copy);
 }
コード例 #20
0
 private void ListView_ItemDrag(object sender, ItemDragEventArgs e)
 {
     _dragSource = sender as ListView;
     if (_dragSource != null)
         _dragSource.DoDragDrop(_dragSource.SelectedItems, DragDropEffects.Move);
 }
コード例 #21
0
 private void MovieRentalStartDrag(object sender, ItemDragEventArgs e)
 {
     lstRentals.DoDragDrop(e.Item, DragDropEffects.Move);
 }