加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 05:28:36 所属栏目:Windows 来源:网络整理
导读:我的资源中有一个图像,我想在 Windows手机中将其作为按钮的背景提供. 怎么做? 我试过这个,但是给出了一个错误 Button Content="" HorizontalAlignment="Left" BorderBrush="Transparent" Margin="131,681,0" Name="button2" Width="81" Grid.Row="1" Click=
我的资源中有一个图像,我想在 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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读