How to set a background of WPF Window? -
i have simple wpf window. intend set it's background 1 of images added project embedded resource. tried:
<window x:class="a_boggle.window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="a-boggle" height="300" width="625" resizemode="noresize" windowstartuplocation="centerscreen" name="game"> <window.background> <imagebrush imagesource="background.jpg"></imagebrush> </window.background> <grid> </grid>
but this, this: "error 1 file splash.jpg not part of project or 'build action' property not set 'resource'."
any ideas?
go image within vs , set item resource. right click -> properties -> build action -> resource
update:
you need change path if in folder. ie...resources/background.jpg
Comments
Post a Comment