문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top