c# - 访问项目资源中的图像?

标签 c# .net

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

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

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

最佳答案

something.Image = Namespace.ProjectName.Properties.Resources.ImageName;

关于c# - 访问项目资源中的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/106396/

相关文章:

c# - 正则表达式匹配中的命名组

c# - 整个方法只有一个 return()

c# - 我的单元测试有什么问题? C#

c# - WCF 服务 wsdl 客户端错误

c# - JSON.NET 到 C# 对象

c# - 在 IEnumerable 上使用 C# 实现的 PowerShell 中的 GetEnumerator

c# - 右键单击时如何防止 ListBox 选择项目?

c# - 在 String.Format 中转义大括号 '{'

.net - Realm for Xamarin 中的简单迁移

.net - 通过nuget命令行执行powershell脚本