简体   繁体   English

如何修整网格的角并删除背景?

[英]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 我决定使MainWindow透明,然后创建两个网格,一个在顶部带有弯曲的网格,另一个在其下方,该网格将容纳所有控件,因此现在看起来像这样

在此处输入图片说明

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: 这会给你这个:

会给你这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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