private void CalcVBar (int top, int bottom, bool horz_vis)
{
initializing_scrollbars = true;
vbar.Top = 0;
vbar.Left = ClientRectangle.Right - vbar.Width;
vbar.Height = ClientRectangle.Height - (horz_vis ? SystemInformation.HorizontalScrollBarHeight : 0);
vbar.LargeChange = 50;
vbar.Minimum = Math.Min (top, 0);
vbar.Maximum = Math.Max (bottom - ClientSize.Height + 51 + (horz_vis ? SystemInformation.HorizontalScrollBarHeight : 0), 0);
vbar.Value = 0;
vbar_value = 0;
vbar.ValueChanged += new EventHandler (VBarValueChanged);
XplatUI.SetZOrder (vbar.Handle, IntPtr.Zero, true, false);
initializing_scrollbars = false;
}