前段时间在研究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>