我的资源中有一张图片,我想将其作为我在 Windows Phone 中的按钮的背景。 怎么做? 我试过了,但是报错
<Button Content="" HorizontalAlignment="Left" BorderBrush="Transparent" Margin="131,681,0,0" Name="button2" Width="81" Grid.Row="1" Click="button2_Click" Height="64" VerticalAlignment="Top" Background="Images/pause.png"/>
最佳答案
试试这个,
<Button Content="" HorizontalAlignment="Left" Margin="114,36,0,0" Grid.Row="1" VerticalAlignment="Top">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/Images/pause.png"/>
</Button.Background>
</Button>
关于windows - 将图像作为按钮控件的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10117078/