-1

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
  • is this winforms? wpf? – Jonesopolis Aug 16 '13 at 23:42
  • What do you mean by "doesn't react"? If you resize the child panel within a parent one, as you called it, it does resize as well. – Tarec Aug 16 '13 at 23:58
  • It doesn't. I checked it. The size of the parent stays the same, etheir the child is "over the border" already with the bigger size. – Roboter Williams Aug 17 '13 at 00:03
  • Then your child panel doesn't lie on the parent one. It doesn't matter whether the main panel has the autoscroll or docking on. None of the elements lying within the panel cannot draw itself beyond it. – Tarec Aug 17 '13 at 00:08
  • I just looked. It is. Well, that's possibly strange... Mh.. There's is also a menu above the parent panel (Really not in it)... – Roboter Williams Aug 17 '13 at 00:11

1 Answers1

0

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.

Tarec
  • 3,268
  • 4
  • 30
  • 47