Rizwan Khan
Rizwan Khan

Reputation: 401

Resizing the form elements on resizing the form

how to Resizing the Windows form elements on resizing the form? is there any way to set the width of picturebox, panel, etc 100% like CSS? suggest me some help for best practices of layout? When i resize the Windows form, I want that Image size also change when i resize the image. like Windows Picture Viewer

Upvotes: 1

Views: 5582

Answers (3)

McKay
McKay

Reputation: 12604

What you may want is to set the properties of the image control to fill the image inside.

Steps:

  1. I created a new windows form
  2. I added a picture box to the form
  3. I set the picture box "Dock" property to "Fill"
  4. I added an image to the picture box
  5. I set the SizeMode property to "StretchImage" ("Zoom" might better fit your needs")

Upvotes: 1

Darren Young
Darren Young

Reputation: 11090

You would probably be okay with the Anchor property of the controls.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.anchor(v=vs.71).aspx

Upvotes: 4

qJake
qJake

Reputation: 17119

You should look into Control Docking, it'll probably suit your needs.

Upvotes: 2

Related Questions