【发布时间】:2019-12-11 23:01:23
【问题描述】:
我想在 datagridview 中将图像设置为按钮的背景。所以我遵循以下答案DataGridView Image for Button Column。我已将我的图像添加到这样的资源中:
我的问题是我无法访问资源中的图像。
Properties.Resources. //Here the intellisense doesn't give me the name of my resource.
如何访问我的资源?
【问题讨论】:
-
直接资源名
StatementPrint.printer -
您已将图像添加到表单的本地资源中。将其添加到项目资源文件中。还要记住,表单的本地资源不需要代码生成,所以不要在资源设计器中为
Access Modifier选择Publlic,而是选择no code Generation。但是对于项目资源文件,让它成为internal(默认情况下。) -
@RezaAghaei 非常感谢,这是问题所在,因为我将它用作本地资源
标签: c# winforms datagridview visual-studio-2017 embedded-resource