WPF绘制半透明边框的窗体

前段时间在研究winform如何绘制半透明的窗体,要达到预期的效果很是麻烦,用WPF就简单多了

 先来看看效果:

 

实现

windows1.xaml

<Window x:Class="JStore.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300" WindowStyle="None" AllowsTransparency="True" Background="Transparent">
    <Grid>
        <Border CornerRadius="0,0,0,0"
                Background="White"
                BorderBrush="Gray"
                BorderThickness="1"
                Margin="10,10,10,10">
            <Border.Effect>
                <DropShadowEffect Color="Gray" BlurRadius="10" ShadowDepth="0" Opacity="0.8" />
            </Border.Effect>
        </Border>
    </Grid>
</Window>

 

 

posted @ 2012-11-05 14:22  Jerome's Blog  阅读(5383)  评论(0编辑  收藏  举报