/// <summary>
            /// Gets called when the mouse enters the control while dragging.
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void _DragEnter(object sender, DragEventArgs e)
            {
                var treeView = sender as TreeView;

                if (treeView == null || treeView != this._treeView)
                {
                    return;
                }

                if (!e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false) || (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode") != this._draggedNode)
                {
                    e.Effect = DragDropEffects.None;
                    return;
                }

                var screen = new Drawing.Point(e.X, e.Y);
                var client = treeView.PointToClient(screen);
                var window = client;

                DragHelper.ImageList_DragEnter(treeView.Handle, window.X, window.Y);

                // Enable timer for scrolling dragged item
                this._dragScrollTimer.Enabled = true;

                e.Effect = DragDropEffects.Move;
            }
Ejemplo n.º 2
0
        private void TemplateTree_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
        {
            Point point = TemplateTree.PointToClient(new Point(e.X, e.Y));

            DragHelper.ImageList_DragEnter(TemplateTree.Handle, point.X, point.Y);
            e.Effect = DragDropEffects.Move;
        }
Ejemplo n.º 3
0
        private void treeView1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.Text))
            {
                e.Effect = DragDropEffects.Move;
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }


            DragHelper.ImageList_DragEnter(this.treeView1.Handle, e.X - this.treeView1.Left,
                                           e.Y - this.treeView1.Top);
        }
Ejemplo n.º 4
0
        protected override void OnDragEnter(DragEventArgs drgevent)
        {
            try
            {
                DragHelper.ImageList_DragEnter(this.Handle, drgevent.X - this.Left,
                                               drgevent.Y - this.Top);

                // Enable timer for scrolling dragged item
                this.timer.Enabled = true;
            }
            catch (Exception e)
            {
                ACSLog.InsertLog(MessageBoxIcon.Error, e);
            }
        }
Ejemplo n.º 5
0
        private void suiteTreeView_DragEnter(object sender, DragEventArgs e)
        {
            DragHelper.ImageList_DragEnter(this.suiteTreeView.Handle, e.X - this.suiteTreeView.Left, e.Y - this.suiteTreeView.Top);

            this.timer.Enabled = true;
        }
Ejemplo n.º 6
0
 private void BetterTreeView_DragEnter(object sender, DragEventArgs e)
 {
     DragHelper.ImageList_DragEnter(Handle, e.X - Left,
                                    e.Y - Top);
 }