开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜