Coolguy
Coolguy

Reputation: 2285

C# Fix the size of picture box even when the size of the windows is changed

May I know how do we fixed the size of the picture box? Because for now, everytime I drag to change the winform size, the size of the picture box on it will change too.

Upvotes: 0

Views: 1683

Answers (2)

Ria
Ria

Reputation: 10357

Check Anchor property of your PictureBox and make sure the Dock property is set to None;

Use the Anchor property to define how a control is automatically resized as its parent control is resized:

Control.Anchor: Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.

Upvotes: 0

Habib
Habib

Reputation: 223392

You have set your anchor property of your PictureBox to:

Top, Bottom, Left, Right

You may set it to

Top, Left

Look in the properties for the picture box, Currently it will be: enter image description here

Upvotes: 3

Related Questions