Treefrog.Windows.Controls.ViewportControl.ShowVScrollBar C# (CSharp) Method

ShowVScrollBar() private method

private ShowVScrollBar ( bool show ) : void
show bool
return void
        private void ShowVScrollBar(bool show)
        {
            if (show && !_showVScrollBar) {
                _showVScrollBar = true;
                _vScrollBar.Visible = true;
                tableLayoutPanel1.SetColumnSpan(panel1, 1);
                tableLayoutPanel1.SetColumnSpan(_hScrollBar, 1);
                panel1.Width = tableLayoutPanel1.Width - _vScrollBar.Width;
                _control.Control.Width = panel1.Width;
                _vScrollBar.Left = panel1.Width;
                _hScrollBar.Width = panel1.Width;
                _vScrollBar.Height = panel1.Height;
            }
            else if (!show && _showVScrollBar) {
                _showVScrollBar = false;
                _vScrollBar.Value = 0;
                _vScrollBar.Visible = false;
                tableLayoutPanel1.SetColumnSpan(panel1, 2);
                tableLayoutPanel1.SetColumnSpan(_hScrollBar, 2);
                panel1.Width = tableLayoutPanel1.Width;
                _control.Control.Width = panel1.Width;
                _hScrollBar.Width = panel1.Width;
                _vScrollBar.Height = panel1.Height;
            }
        }