I have a picturebox on my form, on form load the form is maximized on the screen. What I want is to align this picture in the top right hand corner of the form. It seems simple, but I cant figure out how to do it. Any suggestions please let me know.
Printable View
I have a picturebox on my form, on form load the form is maximized on the screen. What I want is to align this picture in the top right hand corner of the form. It seems simple, but I cant figure out how to do it. Any suggestions please let me know.
Firstly, use the Form 'Activated' event. Secondly, you can align the picture box by doing something like..
pictureBox.Location = new Point(this.Size.Width - pictureBox.Width, 0);
That would be the top right of the form
Just set the Anchor property of the PictureBox to Top, Left and it will maintain its position relative to the top, left corner regardless of how you resize the form. You then set the Size and Location of the control such that it is the distance from those edges that you want it to maintain.
Thanks, setting the anchor worked perfectly