user3036459
user3036459

Reputation:

Make picture box locked in corner?

How can I make my picture box always locked in the top-right corner of my winforms application, even if I resize the form window?

I tried to do this:

pictureBox1.Margin = new Padding(5,5,0,0);

But it didn't work. I want it to be padding 5 from top and 5 from right, always. No matter what the size of the form window is.

Upvotes: 1

Views: 1561

Answers (2)

Belial09
Belial09

Reputation: 694

just move the control to its position and set

Dock = None

Anchor = Top & Right

Upvotes: 0

jmcilhinney
jmcilhinney

Reputation: 54427

Set the Anchor property to Top,Right.

Upvotes: 5

Related Questions