如果一個WPF窗體設置成WindowStyle="None" AllowsTransparency="True" Background="Transparent", 那麼就無法在運行時調整大小。
但如果加上 ResizeMode="CanResizeWithGrip", 運行時,在窗體的右下角就出現一個小三角型,用鼠標就可以拉伸窗體調整大小。
<Window x:Class="TestProject.ScratchWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Opacity="1.0"
ResizeMode="CanResizeWithGrip"
WindowStyle="None"
AllowsTransparency="True"
Title="Test Window">
<!-- Window Contents Here -->
</Window>