【问题标题】:Accessing an image in the projects resources?访问项目资源中的图像?
【发布时间】:2008-09-19 23:31:21
【问题描述】:

如何在运行时访问已添加到项目资源中的图像?

我希望能够做这样的事情:

if (value) {
    picBox1.image = Resources.imageA;
}
else 
{
    picBox2.image = Resources.imageB;
}

【问题讨论】:

    标签: c# .net


    【解决方案1】:

    something.Image = 命名空间.ProjectName.Properties.Resources.ImageName;

    【讨论】:

      猜你喜欢
      • 2016-12-28
      • 2012-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-24
      • 2015-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多