I use VS2015/C# on Win10 to test Panel control:
Add 50 PictureBox controls into panel1:
Image img = Image.FromFile(Application.StartupPath + @"\1.png"); //any image
panel1.AutoScroll = true;
panel1.Height = 500;
for (int i = 0; i < 50; i++)
{
PictureBox pb = new PictureBox();
pb.Left = i*10;
pb.Top = i * (img.Height + 10);
pb.SizeMode = PictureBoxSizeMode.AutoSize;
pb.Image = img;
toolTip1.SetToolTip(pb, i.ToString()+": "+pb.Top.ToString());
panel1.Controls.Add(pb);
}
If the 'Top' of a picture box is less than 32767, the picture box can be placed in right position. But if the 'Top' of a picture box is greater than 32767, the picture box can not be placed in right position, it will be placed at the bottom of the panel. In an another word, the maximum scrollable height of Panel control is like 32767.
I want all picture box in wanted position in panel. Is any method to enlarge panel scrollable size?
What I have tried:
This issue is exist on Win7/8/10, but no found in WinXP. It is no relation with VS versions and .NET framework versions, just in relation with Windows versions.