WPF中的無邊框透明可縮放窗體----一行代碼解決

 

<Window x:Class="iconfontDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:iconfontDemo"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800" WindowStyle="None" 
        AllowsTransparency="True"
        Background="Transparent"
        >
    <WindowChrome.WindowChrome>
        <WindowChrome   ResizeBorderThickness="4"/>
    </WindowChrome.WindowChrome>
    <StackPanel Background="White">
        
    </StackPanel>
</Window>

ResizeBorderThickness  只需要設置這一個屬性就好了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章