Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 2
0
 private void tvNewBots_DragComplete(object sender, DragCompleteEventArgs e)
 {
     DoDrop(e.SourceNode);
 }
Ejemplo n.º 3
0
 private void tvNewBots_DragComplete(object sender, DragCompleteEventArgs e)
 {
     DoDrop(e.SourceNode);
 }
Ejemplo n.º 4
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);
                }
            }
        }