SourceGrid.CustomScrollControl.RecalcCustomScrollBars C# (CSharp) Method

RecalcCustomScrollBars() private method

Recalculate the scrollbars position and size.
private RecalcCustomScrollBars ( ) : void
return void
        private void RecalcCustomScrollBars()
        {
            SuspendLayout();

            //I use the base.DisplayRectangle to returns the actual Display without consider the size of the scrollbars

            int scrollRows = GetScrollRows(base.DisplayRectangle.Height);
            int scrollCols = GetScrollColumns(base.DisplayRectangle.Width);

            PrepareScrollBars(scrollCols > 0, scrollRows > 0);

            //now I recheck the area with the scrollbars
            scrollRows = GetScrollRows(DisplayRectangle.Height);
            scrollCols = GetScrollColumns(DisplayRectangle.Width);

            PrepareScrollBars(scrollCols > 0, scrollRows > 0);

            RecalcVScrollBar(scrollRows);
            RecalcHScrollBar(scrollCols);

            //forzo un ridisegno
            InvalidateScrollableArea();

            ResumeLayout(true);
        }