Esempio n. 1
0
        private void ScrollInfoText(int rows, InfoScrollMode scrollMode)
        {
            SuspendLayout();
            if (_currentInfo == null)
            {
                return;
            }


            switch (scrollMode)
            {
            case InfoScrollMode.Line:
                if (rows > 0 && _currentInfo.TotalRows <= _currentInfo.VisibleRows)
                {
                    return;
                }

                infoRow += rows;
                break;

            case InfoScrollMode.Page:
                rows = _currentInfo.VisibleRows * rows;
                if (rows > 0 && _currentInfo.TotalRows <= _currentInfo.VisibleRows)
                {
                    return;
                }

                infoRow += rows;
                break;

            case InfoScrollMode.All:
                if (rows < 0)
                {
                    infoRow = 0;
                }
                else
                {
                    int i = _currentInfo.TotalRows;
                    while (i > _currentInfo.VisibleRows)
                    {
                        infoRow += _currentInfo.VisibleRows;
                        i        = GetMaxRows(GetShortInfoText());
                    }
                }
                break;
            }
            ResumeLayout();
            infoRow = Math.Max(infoRow, 0);
        }
Esempio n. 2
0
        private void ScrollInfoText(int rows, InfoScrollMode scrollMode)
        {
            SuspendLayout();
            if (_currentInfo == null)
                return;

            switch (scrollMode)
            {
                case InfoScrollMode.Line:
                    if (rows > 0 && _currentInfo.TotalRows <= _currentInfo.VisibleRows)
                        return;

                    infoRow += rows;
                    break;
                case InfoScrollMode.Page:
                    rows = _currentInfo.VisibleRows*rows;
                    if (rows > 0 && _currentInfo.TotalRows <= _currentInfo.VisibleRows)
                        return;

                    infoRow += rows;
                    break;
                case InfoScrollMode.All:
                    if (rows < 0)
                    {
                        infoRow = 0;
                    }
                    else
                    {
                        int i = _currentInfo.TotalRows;
                        while (i > _currentInfo.VisibleRows)
                        {
                            infoRow += _currentInfo.VisibleRows;
                            i = GetMaxRows(GetShortInfoText());
                        }
                    }
                    break;
            }
            ResumeLayout();
            infoRow = Math.Max(infoRow, 0);
        }