WPF Canvas Button?

佐手、 提交于 2020-01-03 03:32:28

问题


I'm learning WPF at the moment.

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.

Regards, Mark


回答1:


You can use a VisualBrush :

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



回答2:


Apologies,

I think I've found the solution. DrawingBrush.

Thanks, Mark



来源:https://stackoverflow.com/questions/1026476/wpf-canvas-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!