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>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM