Hi there.
I have a number of panels in a single window in C# application and I created 2 scrollbars, one for horizontal and one vertical. This is what I currently have:
I have 1 variable and that is the total height all the items take & need. Here is my code on scroll change:
for (int i = 0; i < this._splitMainView.Panel2.Controls.Count; i++)
{
this._splitMainView.Panel2.Controls[i].Location = new Point(
3 - _scrollBarX.Value,
3 + (132 + 6) * (i - 2) - _scrollBarY.Value);
this._splitMainView.Panel2.Controls[i].Refresh();
}
The scrollbar maximum is the total amount of all the containers height, the space in between and a few pixels extra.
As you can see from the picture, it doesn't look good. Even if the maximum in this case is a little around 50 - 100 pixels it still looks like it's a thousand pages long. When I change the SmallChange and LargeChange, the scrollbar bar itself lengthens but then it wont reach the maximum pixels. It will be able to get almost at the end (depening on the SmallChange and LargeChange value) and leave around 5 - 29 px left. And as everyone knows, seeing half is not good.
Does anyone know how to overcome this obstacle or a better way to implement it?