当WindowStyle=None时整个 窗口的样式都没有了包括最大化最新化都没有了。直接上代码吧。。。。
xaml :
<Window x:Class="WindowsNone.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:WindowsNone"
Style="{StaticResource for_noresize_window}"
WindowStyle="None"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!--头部-->
<StackPanel Height="50"
Grid.Row="0"
MouseMove="TitleBar_MouseMove"
MouseDown="TitleBar_MouseDown"
Background="#336681"
VerticalAlignment="Center">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>