• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.ItemDragEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.ItemDragEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ItemDragEventArgs类的具体用法?C# ItemDragEventArgs怎么用?C# ItemDragEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ItemDragEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了ItemDragEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: treeView1_ItemDrag

        private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            // gx2. jsx, jsc reflector
            // ?

            // http://support.microsoft.com/kb/307968

            // we can drag it into scite
            // DragDrop.DoDragDrop returns only after the complete drag-drop process is finished,
            // http://w3facility.org/question/dodragdrop-freezes-winforms-app-sometimes/
            // https://msdn.microsoft.com/en-us/library/ms649011(VS.85).aspx

            // http://www.codeproject.com/Articles/17266/Drag-and-Drop-Items-in-a-WPF-ListView

            Console.WriteLine("treeView1_ItemDrag"); ;

            // http://stackoverflow.com/questions/1772102/c-sharp-drag-and-drop-from-my-custom-app-to-notepad
            var x = new DataObject(
                "treeView1_ItemDrag " + new { e.Item }
            );


            // like props/ reg keys/ version nodes
            x.SetData("text/nodes/0", "hello");
            x.SetData("text/nodes/1", "world");

            // https://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop(v=vs.110).aspx
            //this.DoDragDrop("treeView1_ItemDrag " + new { e.Item }, DragDropEffects.Copy);
            treeView1.DoDragDrop(x, DragDropEffects.Copy);

            // https://code.google.com/p/chromium/issues/detail?id=31037
            // https://searchcode.com/codesearch/view/32985148/
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:33,代码来源:ApplicationControl.cs


示例2: OnItemDrag

        protected override void OnItemDrag(ItemDragEventArgs e)
        {
            //Begins a drag-and-drop operation in the ListView control.
            this.DoDragDrop(this.SelectedItems, DragDropEffects.Move);

            base.OnItemDrag(e);
        }
开发者ID:memerdot,项目名称:puyotools-1,代码行数:7,代码来源:ListViewWithReordering.cs


示例3: ItemDrag

        /// <summary>
        /// This method initialises the dragging of a ListViewItem
        /// </summary>
        void ItemDrag(object sender, ItemDragEventArgs e)
        {
            ReleaseCom();

            startButton = e.Button;

            FileSystemInfo[] items = listView.GetSelected();

            List<ShellItem> list = new List<ShellItem>();
            foreach (FileSystemInfo f in items)
            {
                //IntPtr[] pidls = ShellFolder.GetPIDLs(items);
                IntPtr pidl = ShellFolder.GetPathPIDL(f);
                //IShellFolder parentShellFolder = ShellFolder.GetParentShellFolder(items[0]);
                string parentDirectory = ShellFolder.GetParentDirectoryPath(f);
                IntPtr parentShellFolder = ShellFolder.GetShellFolderIntPtr(parentDirectory);


                ShellItem item = new ShellItem(browser, pidl, parentShellFolder);
                list.Add(item);
            }

            dataObjectPtr = ShellHelper.GetIDataObject(list.ToArray());

            if (dataObjectPtr != IntPtr.Zero)
            {
                DragDropEffects effects;
                //OnDragStart(new DragEnterEventArgs((items[0].ParentItem != null ? items[0].ParentItem : items[0]), fileView.ListView));
                ShellAPI.DoDragDrop(dataObjectPtr, this, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move, out effects);
                //OnDragEnd(new EventArgs());
            }
        }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:35,代码来源:BrowserDragWrappers.cs


示例4: stencilChooserTreeView_ItemDrag

 private void stencilChooserTreeView_ItemDrag(object sender, ItemDragEventArgs e)
 {
   ModelStencil modelStencil;
   if (modelStencils.TryGetValue(((TreeNode)e.Item).Text, out modelStencil))
   {
     this.DoDragDrop(modelStencil, DragDropEffects.Move);
   }
 }
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:8,代码来源:StencilChooser.cs


示例5: OnItemDrag

 protected override void OnItemDrag(ItemDragEventArgs e)
 {
     // can't drag the root node
     if (!base.SelectedNodes.Contains(base.Nodes[0]))
         DoDragDrop(BeginDragNodes(base.SelectedNodes), DragDropEffects.All);
     else
         base.OnItemDrag(e);
 }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:8,代码来源:DragDropTreeView.cs


示例6: treeView_ItemDrag

        private void treeView_ItemDrag(object sender, ItemDragEventArgs e)
        {
            Debug.WriteLine("\t Source Tree Item Dragged... ");

            if (e.Button == MouseButtons.Left)
            {
                treeView.DoDragDrop(e.Item.ToString(), DragDropEffects.Copy | DragDropEffects.All);
            }
        }
开发者ID:WeDoCrm,项目名称:MessengerSocket,代码行数:9,代码来源:SourceForm.cs


示例7: _folders_ItemDrag

		private void _folders_ItemDrag(object sender, ItemDragEventArgs e)
		{
			// allow dragging of nodes
			var selection = (ISelection)e.Item;

			// send the node
			if (selection.Item != null)
				_folders.DoDragDrop(selection.Item, DragDropEffects.Move);
		}
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:FolderExplorerConfigurationComponentControl.cs


示例8: OnItemDrag

    //protected override void WndProc(ref System.Windows.Forms.Message m)
    //{
    //  const int WM_PAINT = 0xf ;

    //  switch(m.Msg)
    //  {
    //    case WM_PAINT:
    //      if(this.View == System.Windows.Forms.View.Details && this.Columns.Count > 0)
    //      {
    //        this.Columns[this.Columns.Count - 1].Width = -2 ;
    //      }
    //      break ;
    //  }

    //  base.WndProc (ref m);
    //}

    protected override void OnItemDrag(ItemDragEventArgs e)
    {
      if (!this.AllowRowReorder)
      {
        return;
      }
      base.DoDragDrop(REORDER, DragDropEffects.Move);
      base.OnItemDrag(e);
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:26,代码来源:MPListView.cs


示例9: listView1_ItemDrag

        private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            if (e.Item is ListViewItem)
            {
                var listViewItem = e.Item as ListViewItem;

                if (!string.IsNullOrEmpty(listViewItem.Text))
                    DoDragDrop(new DragItem(listViewItem.Text), DragDropEffects.Copy);
            }
        }
开发者ID:ibrahimbensalah,项目名称:XmallSteps,代码行数:10,代码来源:ToolBoxControl.cs


示例10: CourseTree_ItemDrag

        private void CourseTree_ItemDrag(object sender, ItemDragEventArgs e)
        {
            if (EditorObserver.HostEditorMode == Utils.Controls.HtmlEditing.Enums.HtmlEditingToolMode.Design)
            {
                dragNode = (TreeNode)e.Item;
                CourseTree.SelectedNode = dragNode;

                // Запрещено перемещать следующие узлы: 
                // корень учебной программы, входы, выходы, ответы, компетенции 
                // во входах, кроме внешних компетенций.
                if (!(dragNode is CourseRoot ||
                      dragNode is InConceptParent ||
                      dragNode is OutConceptParent ||
                      dragNode is Response ||
                      dragNode is InConceptParent &&
                      dragNode.Parent == CourseTree.InConceptsParent ||
                      dragNode is InDummyConcept &&
                      dragNode.Parent != CourseTree.InConceptsParent))
                {
                    //if (((CourseItem)dragNode).NodeType == Enums.ItemType.Question)
                    //{
                    //    question = (dragNode as Question);
                    //    priorParent = (dragNode.Parent as ECNode);
                    //}

                    dragImageList.Images.Clear();
                    if (dragNode.Bounds.Size.Width + CourseTree.Indent > 256)
                    {
                        dragImageList.ImageSize = new Size(256, dragNode.Bounds.Height);
                    }
                    else
                    {
                        dragImageList.ImageSize = new Size(dragNode.Bounds.Size.Width + CourseTree.Indent,
                                                           dragNode.Bounds.Height);
                    }
                    var bmp = new Bitmap(dragNode.Bounds.Width + CourseTree.Indent, dragNode.Bounds.Height);
                    var g = Graphics.FromImage(bmp);
                    g.DrawString(dragNode.Text, CourseTree.Font, new SolidBrush(CourseTree.ForeColor), CourseTree.Indent,
                                 1.0f);
                    dragImageList.Images.Add(bmp);
                    var p = CourseTree.PointToClient(Control.MousePosition);
                    var dx = p.X + CourseTree.Indent - dragNode.Bounds.Left;
                    var dy = p.Y - dragNode.Bounds.Top;
                    if (DragHelper.ImageList_BeginDrag(dragImageList.Handle, 0, dx, dy))
                    {
                        CourseTree.DoDragDrop(bmp, DragDropEffects.Move);
                        DragHelper.ImageList_EndDrag();
                    }
                }
            }
        }
开发者ID:AlexGaidukov,项目名称:gipertest_streaming,代码行数:51,代码来源:CourseTreeDragDropHelper.cs


示例11: listView_ItemDrag

        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);
        }
开发者ID:timmersuk,项目名称:KSP-Mod-Admin-aOS,代码行数:15,代码来源:frmColumnSelection.cs


示例12: ItemDrag

        /// <summary>
        /// This method initialises the dragging of a TreeNode
        /// </summary>
        void ItemDrag(object sender, ItemDragEventArgs e)
        {
            ReleaseCom();

            startButton = e.Button;
            ShellItem item = (ShellItem)((TreeNode)e.Item).Tag;
            dataObjectPtr = ShellHelper.GetIDataObject(new ShellItem[] { item });

            if (dataObjectPtr != IntPtr.Zero)
            {
                DragDropEffects effects;
                OnDragStart(new DragEnterEventArgs((item.ParentItem != null ? item.ParentItem : item), br.FolderView));
                ShellAPI.DoDragDrop(dataObjectPtr, this, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move, out effects);
                OnDragEnd(new EventArgs());
            }
        }
开发者ID:Alenochka17,项目名称:laba3,代码行数:19,代码来源:BrowserDragWrappers.cs


示例13: ItemDragEvent

		// Used to start a drag
		protected void ItemDragEvent(object sender, ItemDragEventArgs e)
		{
			try {
				if (e.Item is IDragDropItem) {
					IDragDropItem node = (IDragDropItem)e.Item;
					node.SelectThisItem();

					if (node.IsDragSource) {
						// Not too elegant, but we might be dragging
						// controls to the design surface
						DesignerHost.Host.AddingControls = true;
						((Control)_control).DoDragDrop(node, DragDropEffects.Copy);
						DesignerHost.Host.AddingControls = false;
					}
				}
			} catch (Exception ex) {
				TraceUtil.WriteLineWarning(this, "ItemDragEvent exception: " + ex);
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:20,代码来源:DragDropSupport.cs


示例14: listViewResults_ItemDrag

        private void listViewResults_ItemDrag(object sender, ItemDragEventArgs e)
        {
            List<int> cardIDs = new List<int>();

            foreach (ListViewItem item in listViewResults.SelectedItems)
            {
                if(item is IDListViewItem)
                    cardIDs.Add(((IDListViewItem)item).ID);
            }

            if (cardIDs.Count > 0)
            {
                LanguageData dataLayer = new LanguageData();
                string description = string.Empty;

                foreach (dsLanguageData.CardRow card in dataLayer.GetCardsByIDs(cardIDs))
                {
                    description += ", " + card.Question;
                }
                description = description.Remove(0, 2);

                DoDragDrop(new CardDragDropHolder(this, cardIDs, description, CardDragDropAction.Add), DragDropEffects.All);
            }
        }
开发者ID:eneifert,项目名称:LanguageLearner,代码行数:24,代码来源:CardSearchControl.cs


示例15: treLifestyles_ItemDrag

 private void treLifestyles_ItemDrag(object sender, ItemDragEventArgs e)
 {
     try
     {
         if (treLifestyles.SelectedNode.Level != 1)
             return;
     }
     catch
     {
         return;
     }
     _intDragLevel = treLifestyles.SelectedNode.Level;
     DoDragDrop(e.Item, DragDropEffects.Move);
 }
开发者ID:cormanater,项目名称:chummer5a,代码行数:14,代码来源:frmCreate.cs


示例16: treWeapons_ItemDrag

        private void treWeapons_ItemDrag(object sender, ItemDragEventArgs e)
        {
            try
            {
                if (treWeapons.SelectedNode.Level != 1 && treWeapons.SelectedNode.Level != 0)
                    return;

                // Do not allow the root element to be moved.
                if (treWeapons.SelectedNode.Tag.ToString() == "Node_SelectedWeapons")
                    return;
            }
            catch
            {
                return;
            }
            _intDragLevel = treWeapons.SelectedNode.Level;
            DoDragDrop(e.Item, DragDropEffects.Move);
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:18,代码来源:frmCreate.cs


示例17: treeView1_ItemDrag

 private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
 {
     if (e.Item is EditorItem)
         DoDragDrop(e.Item, DragDropEffects.Move);
 }
开发者ID:nagyist,项目名称:StreamDesk,代码行数:5,代码来源:StreamDatabaseEditor.cs


示例18: treeView1_ItemDrag

 private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
 {
     if (((TreeNode)e.Item).Tag is Layer) return;
     if (((TreeNode)e.Item).Tag is Level) return;
     Editor.Instance.beginCommand("Drag Item");
     DoDragDrop(e.Item, DragDropEffects.Move);
 }
开发者ID:hzl2928963,项目名称:gleed2d,代码行数:7,代码来源:MainForm.cs


示例19: listView1_ItemDrag

 private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
 {
     ListViewItem lvi = (ListViewItem)e.Item;
     if (lvi.Tag.ToString() == "folder") return;
     toolStripStatusLabel1.Text = lvi.ToolTipText;
     Bitmap bmp = new Bitmap(listView1.LargeImageList.Images[lvi.ImageKey]);
     dragcursor = new Cursor(bmp.GetHicon());
     listView1.DoDragDrop(e.Item, DragDropEffects.Move);
 }
开发者ID:hzl2928963,项目名称:gleed2d,代码行数:9,代码来源:MainForm.cs


示例20: lstDBSpecies_ItemDrag

 private void lstDBSpecies_ItemDrag(object sender, ItemDragEventArgs e)
 {
   SpecieDrag drag = new SpecieDrag(new DataRow[lstDBSpecies.SelectedItems.Count]);
   for (int i = 0; i < lstDBSpecies.SelectedItems.Count; i++)
     drag.Value[i] = (DataRow)lstDBSpecies.SelectedItems[i].Tag;
   DoDragDrop(drag, DragDropEffects.Move | DragDropEffects.Link);
 }
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:7,代码来源:FrmMain.cs



注:本文中的System.Windows.Forms.ItemDragEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.KeyEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Forms.ItemCheckedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap