现在的位置: 首页 > 综合 > 正文

WPF非矩形窗口实现

2012年10月18日 ⁄ 综合 ⁄ 共 464字 ⁄ 字号 评论关闭

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

代码

<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得到。

【上篇】
【下篇】

抱歉!评论已关闭.