WPF画布按钮? [英] WPF Canvas Button?

查看:224
本文介绍了WPF画布按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我此刻学习WPF。

我有一个矢量图形的画布,我想为背景的按钮来使用,但我似乎无法找到一种方法在文档中做到这一点。我认为这将是想做一个明显的事情。

I have a vector graphics canvas that I'd like to use as the background for a button, but I can't seem to find a way to do this in the documentation. I thought this would be an obvious thing to want to do.

问候,
马克

推荐答案

您可以使用的VisualBrush:

You can use a VisualBrush :

<Button Content="Hello">
    <Button.Background>
        <VisualBrush>
            <VisualBrush.Visual>
                <!-- Your vector graphics here -->
            </VisualBrush.Visual>
        </VisualBrush>
    </Button.Background>
</Button>

这篇关于WPF画布按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆