wpf无边窗体实现有两种方式:
第一种:
<Window x:Class="Zhaoxi.LayoutStudy.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:Zhaoxi.LayoutStudy"
mc:Ignorable="d"
Title="MainWindow" Width="400" FontSize="16"
SizeToContent ="Height"
WindowStartupLocation="CenterScreen"
WindowStyle="None" AllowsTransparency="True" Background="Transparent">
<Border Background="#EEE" Margin="5" CornerRadius="5"/>
</Window>
第二种:
<Window x:Class="Zhaoxi.LayoutStudy.CanvasWin"
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:Zhaoxi.LayoutStudy"
mc:Ignorable="d" FontSize="20"
Title="CanvasWin" Height="450" Width="800">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="-1" CaptionHeight="30" UseAeroCaptionButtons="False"
NonClientFrameEdges="None" />
</Window>