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

 先来看看效果:

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>

 

 

相关文章:

  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-06-15
  • 2021-09-14
  • 2021-10-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案