1

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

I don't know why :(

<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>

Anyone have an idea please ?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Walter Fabio Simoni
  • 5,671
  • 15
  • 55
  • 80

2 Answers2

1

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.

Clemens
  • 123,504
  • 12
  • 155
  • 268
0

You must check if your image has set Build Action property to Resource:

enter image description here

kmatyaszek
  • 19,016
  • 9
  • 60
  • 65