WPF窗口圆角

概览:

窗口(控件)圆角

1
2
3
4
5
6
7
8
9
10
11
12
13
14

<Grid Background="Transparent">
<Border BorderThickness="1" BorderBrush="#FF2A2E33" CornerRadius="10,10,10,10" Background="#EE2A2E33"/>
<WrapPanel>
<Image x:Name="avatar" Width="25" Height="25" Source="assets/titlebutton-max-active@2.png" Margin="3,0,0,0"/>
<Label x:Name="user_name" Content="圆角窗口实例" FontSize="13" VerticalAlignment="Center" Foreground="#FFFFFF"/>
WrapPanel>
<WrapPanel HorizontalAlignment="Right" Margin="0,0,5,0">
<Image Source="assets/titlebutton-min@2.png"/>
<Image Source="assets/titlebutton-max@2.png"/>
<Image Width="23" Source="assets/titlebutton-close@2.png"/>
WrapPanel>
Grid>

行2,border元素

  • BorderThickness="1"
  • BorderBrush="#FF2A2E33"
  • CornerRadius="10,10,10,10" 这个就是重点,四个角的角半径。
  • Background="#EE2A2E33"背景色
------ 文章已经结束,谢谢你的阅读 ------
------ article has ended,thank you for reading ------
Thanks support Me

---------------- The End ----------------