Пример #1
0
        private void OnScrollTimerTick(object sender, EventArgs e)
        {
            var point     = tree.PointToClient(Control.MousePosition);
            var hitInfo   = tree.CalcHitInfo(point);
            var leftCoord = -1;

            if (!CanScroll(hitInfo))
            {
                return;
            }
            if (IsRightScroll(hitInfo))
            {
                var nextColumn = GetNextColumn();
                leftCoord = tree.ViewInfo.GetColumnLeftCoord(nextColumn);
            }
            else if (IsLeftScroll(hitInfo))
            {
                var prevColumn = GetPrevColumn();
                leftCoord = tree.ViewInfo.GetColumnLeftCoord(prevColumn);
            }
            if (leftCoord == -1)
            {
                return;
            }
            leftCoord += tree.ViewInfo.ViewRects.IndicatorWidth;
            if (tree.ViewInfo.HasFixedLeft)
            {
                leftCoord -= tree.ViewInfo.ViewRects.FixedLeft.Width;
                leftCoord += tree.FixedLineWidth;
            }
            tree.LeftCoord = leftCoord;
        }