eddy white
eddy white

Reputation: 303

Autosizing pictures with Windows Forms

I need to place 3 picture boxes, which are all in a own panel, side by side.

Conditions:

How could I do this in Visual Studio 2010 C#, Windows Forms?

enter image description here

Upvotes: 1

Views: 128

Answers (2)

Charlie
Charlie

Reputation: 4895

I think ,following these instructions will fulfill your requirements

1)right click on other panels and select bring to front

2)anchor the other panels to bottom

3)anchor all other panels panels and picture boxes to top,bottom ,left,right using properties You can manage the interfaces selection ,un-selecting anchors

Upvotes: 0

schei1
schei1

Reputation: 2487

I would suggest that you use a TableLayoutPanel with 3 columns, and place the pictureboxes within the given cells.

Anchor this panel to the parent form, so that when you resize the form, the panel will follow. Since you have panels underneath (as per picture sample) you could anchor to Left, Right and Top. This will anchor the panel to top, left, and will resize all the way to the right for as long as the form goes. Add Bottom if you need to.

The pictureboxes would have the Dock set to DockStyle.Fill.

You could nest more panels within panels, but do it in a sane way :-)

Upvotes: 1

Related Questions