/// <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); } } }
private void tvNewBots_DragComplete(object sender, DragCompleteEventArgs e) { DoDrop(e.SourceNode); }
/// <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); } } }