开发者

c# picturebox question [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

When I add an image into picturebox with C#,it does not come with actual size.

T开发者_运维问答hanks in advance.


No, by default it does not come with actual size.

It does, however, come with a manual, a careful perusal of which reveals that the key lies in setting the control's SizeMode property to the PictureBoxSizeMode value that you desire.

In this case, I suspect that's AutoSize, which ensures that the picture box control is resized according to the actual size of the image that it displays.

You can set this property either in the Visual Studio designer using the Properties window, or through code using the following line in your form's constructor method:

myPictureBox.SizeMode = PictureBoxSizeMode.AutoSize;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜