首页 > 解决方案 > 如何修复图像的“找不到资源”

问题描述

我有一个 wpf 应用程序,它有一个文件夹,其中包含所有需要的图像(称为图像)。在 Images 文件夹中,我有 imgAdd.png 并且文件路径指向我计算机上的正确位置。问题是,当我在 Visual Studio 中打开项目时,我遇到了多个错误,说“无法找到资源 'images/imgadd.png'”。

构建操作设置为资源,文件路径正确,我不确定为什么找不到图片。

ImageSource="imgAdd.png"

Error   3   Cannot locate resource 'images/imgadd.png'.

<CommonControls:ccBilingualButton Canvas.Left="12" Canvas.Top="0" Cursor="Hand" Height="50" HorizontalAlignment="Right" Margin="0,0,86,6" Name="btnAddJustPerson" TabIndex="8" VerticalAlignment="Bottom" Width="75" LabelEnglish="Add" LabelFrench="Add" ImageSource="imgAdd.png" FontWeight="Bold" ImageLocation="Top" Foreground="Black" HorizontalContentAlignment="Center" BorderBrush="DarkBlue" BorderThickness="1" />

标签: vb.netvisual-studio

解决方案


推荐阅读