Question

Well, I've got two Panels. The parent panel is docked (fill) and the autoscroll is true. The Autosize of the child is on true, the dock is none, it got also no anchors and will be filled with a dynamically built picturebox. The resizing of the child is working, however the parent panel doesn't react. Even if I change the AutoScrollMinSize nothing happens. I'm working on Winforms.

Was it helpful?

Solution

Ok, I'll give it a try. Delete all your controlls and do it on clear new ones.

MainPanel on a form - AutoScroll: True, Dock: Fill

SmallerPanel on a MainPanel - AutoSize: True

PictureBox on SmallerPanel - SizeMode: AutoSize

Don't change any other properties. Add a button, double click on it and edit the method

private void button1_Click(object sender, EventArgs e)
{
    pictureBox1.Load("paste some img filepath.jpg");
}

There is no way it won't work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top