C# picturebox location changes when changing image
I have a PictureBox
and when I change the image for some reason the locat开发者_如何学运维ion of the PictureBox
isn't displayed correctly. It is displayed in the lower left corner instead of the top left.
If I check the values of top, left, location etc. it is all correct. Is there something I am forgetting?
myPictureBox.Image = image;
myPictureBox.Location = new Point(0,0);
I think that's because the SizeMode
property is set to AutoSize
, try to set it to Normal
.
Good luck!
精彩评论