简体   繁体   中英

How do I round out the corners of my grid and remove the background?

I am trying to round out the top corners and remove the part that I cut out, so the outer part outside of the bend not inside. This is what I have so far I was trying to bend a grid instead of the 在此处输入图片说明

But I am not sure how to "cut it out"

<Window x:Class="Ah.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Ah"
        mc:Ignorable="d"
        WindowStyle="None" AllowsTransparency="True" Background="Transparent" ResizeMode="NoResize" Height="550" Width="1000">
    <Grid Background="White">
        <Border BorderBrush="Red" BorderThickness="2" CornerRadius="50,50,0,0">

        </Border>
    </Grid>
</Window>

Fixed it. I decided to make the MainWindow transparent and then create two grids, one at the top with the bend and one under it which will hold all the controls so now it looks like this

在此处输入图片说明

Enjoy whoever is making the same thing

<Grid Background="Transparent">
    <Border BorderBrush="Black" Background="Black" BorderThickness="2" VerticalAlignment="Top" Height="30" CornerRadius="5,5,0,0">

    </Border>
    <Grid Background="White" Height="520" VerticalAlignment="Bottom"></Grid>
</Grid>

You can set the background of your border:

<Grid Background="White">
    <Border Background="Red" BorderBrush="White" BorderThickness="2" CornerRadius="50,50,0,0">
    </Border>
</Grid>

Which will give you this:

会给你这个

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