コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDragDrop(System.Windows.Forms.DragEventArgs e)
        {
            // Custom cursor handling
            if (this._dragCursorType == DragCursorType.DragIcon)
            {
                this.Cursor = Cursors.Default;
            }

            this._formDrag.Visible = false;

            // Check it's a treenode being dragged
            if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false))
            {
                TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");

                TreeNode targetNode = this.Nodes[0];
                //dragNode.Remove();

                this.Cursor = Cursors.Default;

                // Call drag complete event
                if (this.DragComplete != null)
                {
                    DragCompleteEventArgs ea = new DragCompleteEventArgs();
                    ea.SourceNode = dragNode;
                    ea.TargetNode = targetNode;

                    this.DragComplete(this, ea);
                }
            }
        }
コード例 #2
0
ファイル: BotsControl.cs プロジェクト: fishxz/omni-bot
 private void tvNewBots_DragComplete(object sender, DragCompleteEventArgs e)
 {
     DoDrop(e.SourceNode);
 }
コード例 #3
0
 private void tvNewBots_DragComplete(object sender, DragCompleteEventArgs e)
 {
     DoDrop(e.SourceNode);
 }
コード例 #4
0
ファイル: TreeViewDragDrop.cs プロジェクト: fishxz/omni-bot
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnDragDrop(System.Windows.Forms.DragEventArgs e)
        {
            // Custom cursor handling
            if ( this._dragCursorType == DragCursorType.DragIcon )
            {
                this.Cursor = Cursors.Default;
            }

            this._formDrag.Visible = false;

            // Check it's a treenode being dragged
            if( e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false) )
            {
                TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");

                TreeNode targetNode = this.Nodes[0];
                //dragNode.Remove();

                this.Cursor = Cursors.Default;

                // Call drag complete event
                if ( this.DragComplete != null )
                {
                    DragCompleteEventArgs ea = new DragCompleteEventArgs();
                    ea.SourceNode = dragNode;
                    ea.TargetNode = targetNode;

                    this.DragComplete(this,ea);
                }
            }
        }