void SetVerticalScrollBar()
{
int width = ClientSize.Width - VScrollBarStrategy.Width;
int height = ClientSize.Height;
int totalHeight = 100;
if (top10Holder != null && top10Holder.Count > 0)
totalHeight = top10Holder.Count * 70;
if (totalHeight < height)
{
VScrollBarStrategy.Enabled = false;
VScrollBarStrategy.Visible = false;
}
else
{
VScrollBarStrategy.Enabled = true;
VScrollBarStrategy.Visible = true;
VScrollBarStrategy.Value = 0;
VScrollBarStrategy.SmallChange = 30;
VScrollBarStrategy.LargeChange = 60;
VScrollBarStrategy.Maximum = Math.Max(totalHeight - height + 80, 0);
VScrollBarStrategy.Location = new Point(width, 0);
VScrollBarStrategy.Height = height;
VScrollBarStrategy.Cursor = Cursors.Default;
}
flowLayoutStrategy.Width = width;
flowLayoutStrategy.Height = totalHeight;
flowLayoutStrategy.Location = Point.Empty;
return;
}