wpf中XAML前端设置窗体全屏显示
<Window x:Class="Test.Full" 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:Test" mc:Ignorable="d" Title="全屏显示" Height="450" Width="800" WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" Topmost="True"> <Grid> Grid> Window>
主要是设置以下几个属性
- WindowState="Maximized" ///最大显示
- WindowStyle="None" ///窗体风格为无风格 去除默认标题栏
- ResizeMode="NoResize" ///不允许窗体拉伸
- Topmost="True" ///窗体置顶 最上层显示