一个按钮上的图片的XmlParseException [英] XmlParseException for a picture on a button

查看:124
本文介绍了一个按钮上的图片的XmlParseException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想插入一张照片,一个按钮,当我运行我的应用程序,我有一个XmlParseException。

I would like to insert a picture une a button, and, when i run my application, i have a XmlParseException.

我不知道为什么:(

<Button Grid.Column="2" HorizontalAlignment="Left" Height="20" Margin="15,2,0,0" VerticalAlignment="Top" Width="41">
    <Button.Background>
         <ImageBrush ImageSource="Images/search.png" Stretch="None"></ImageBrush>
    </Button.Background>
</Button>

任何人都有想法?

推荐答案

确保您的Visual Studio项目包含一个图像文件夹,而文件夹又包含图像文件 search.png 。此外,构建操作必须设置为资源

Make sure that your Visual Studio project contains an Images folder which in turn contains the image file search.png. Moreover the Build Action of the image file must be set to Resource.

这篇关于一个按钮上的图片的XmlParseException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆