简体   繁体   中英

Window with rounded corners WinUI 3

I need the rounded corners in my UWP(WinUI 2) application, but how I understand, it is impossible. So I found github issues, that says what WinUI 3 allows you to create a rounded corners on windows(like in new windows search). Maybe someone can help me with this?

On controls that support it, all you need to do is set the CornerRadius property. How to use styles to set this throughout your application is explained in here: https://docs.microsoft.com/en-us/windows/uwp/design/style/rounded-corner

How to set this on individual controls specifically is documented here: Control.CornerRadius Property

<Button Content="Button" 
        CornerRadius="15" />
<Border BorderThickness="5"
        BorderBrush="Black"
        CornerRadius="15" />

You can easily see this in action in Xaml Studio

XamlStudio 角半径演示

If you are asking if setting this property on a Page is directly supported, I think the answer is not yet . I have not seen any documentation to suggest that it is.
See: Creating chromeless, non-rectangular Windows from UWP or Is it possible to create a borderless UWP application? for possible workarounds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM