windows – 将图像作为按钮控件的背景

前端之家收集整理的这篇文章主要介绍了windows – 将图像作为按钮控件的背景前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我的资源中有一个图像,我想在 Windows手机中将其作为按钮的背景提供.
怎么做?
我试过这个,但是给出了一个错误

<Button Content="" HorizontalAlignment="Left" BorderBrush="Transparent" Margin="131,681,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" Grid.Row="1" VerticalAlignment="Top">
        <Button.Background>
            <ImageBrush Stretch="Fill" ImageSource="/Images/pause.png"/>
        </Button.Background>
    </Button>

猜你在找的Windows相关文章