WPF非矩形窗口实现

一个简单非矩形窗口的实现代码如下:

代码
<Window x:Class="grid_Study.MainWindow"
xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml"
Title
="MainWindow" Height="350" Width="525" AllowsTransparency="True"
WindowStyle
="None" Background="Transparent" >
<Border Width="Auto" Height="Auto" Name="windowFrame" Background="LightBlue"
BorderBrush
="#395984" BorderThickness="1" CornerRadius="80">
</Border>
</Window>

窗体的四个角为圆角,通过设置属性CornerRadius得到。

posted @ 2010-12-15 15:32  绿茶叶  阅读(410)  评论(0编辑  收藏  举报