gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 14:13:56 26 4
gpt4 key购买 nike

我的资源中有一张图片,我想将其作为我在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com