如何在 WPF 中制作圆角形式? [英] How can I make a rounded-corners form in WPF?

查看:46
本文介绍了如何在 WPF 中制作圆角形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使窗口 (WPF) 的角变圆但不起作用,我试图使窗口本身透明并添加带圆角的内部边框,但不起作用.

I am trying to make the corners of a Window (WPF) rounded and it doesn't work, I tried to make the window itself transparent and add an internal border with rounded corners and it doesn't work.

有什么想法吗?

推荐答案

您需要将 WindowStyle 设置为 WindowStyle.None,这将删除镶边,然后您可以允许 Window 元素中的一个属性透明度,并设置背景颜色为透明.所有这些都可以作为 window 标签的属性来完成.

you need to set WindowStyle to WindowStyle.None, which will remove the chrome, then you can allow transparency which is an attribute int the Window element, and set the background color to transparent. All of this can be done as attributes to the window tag.

WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"

要使角变圆,请使用边框并设置cornerRadius 属性

To make the corners rounded, use a border and set the cornerRadius property

这篇关于如何在 WPF 中制作圆角形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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