Quantcast
Channel: 木子屋 - Win编程
Viewing all articles
Browse latest Browse all 206

WinForm控件图片选择本地资源和项目资源的区别

$
0
0
例如,为Form1上的PictureBox控件添加图片:



图片将保存在Form1.resx文件中,控件图片赋值示例:
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));




图片将保存在Resources.resx文件中,控件图片赋值示例:
this.pictureBox1.Image = global::WindowsFormsApplication1.Properties.Resources.image02;

Viewing all articles
Browse latest Browse all 206

Trending Articles