我正在使用WPF创建一个应用程序,并且希望它具有圆角。现在,由于窗体是无边框的,我尝试创建一个圆角矩形并将其放置在顶部,使其看起来像Windows应用程序的顶部栏。
但是我无法做到。
这是我的代码:
<Border CornerRadius="50, 0, 50, 0" BorderBrush="Black" BorderThickness="2" Background="GhostWhite">
<Grid Margin="0,0,0,402">
<Rectangle HorizontalAlignment="Left" Height="44" VerticalAlignment="Top" Width="796">
<Rectangle.Fill>
<VisualBrush Stretch="None">
<VisualBrush.Visual>
<Border Width="800" Height="200" CornerRadius="50,0,0,0" Background="DarkOliveGreen"/>
</VisualBrush.Visual>
</VisualBrush>
</Rectangle.Fill>
</Rectangle>
<Grid HorizontalAlignment="Left" Height="403" Margin="0,44,0,-403" VerticalAlignment="Top" Width="796"/>
</Grid>
</Border>
我的主表单:
我得到的:
<Border>
。它显示“属性“Content”被设置了多次”。 - Omanshu Chaurasia