zoukankan      html  css  js  c++  java
  • WPF 全屏后任务栏被遮挡

    开始有个需求是自定义任务栏,但是在使用【Application.Current.MainWindow.WindowState = WindowState.Maximized;】做到最大化得时候使用 发现窗口最大化了会遮挡任务栏, 网上搜索了一下,原来指定窗口得最大长款就行了

    <Window x:Class="EvalutionScaner.App.Views.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:prism="http://prismlibrary.com/"
            xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
            xmlns:model="clr-namespace:EvalutionScaner.App.Models"
            xmlns:consts="clr-namespace:EvalutionScaner.App.Models.Consts"
            xmlns:i ="http://schemas.microsoft.com/xaml/behaviors"
            mc:Ignorable="d"
            Title="MainWindow"
            TextElement.Foreground="{DynamicResource MaterialDesignBody}"
            Background="{DynamicResource MaterialDesignPaper}"
            prism:ViewModelLocator.AutoWireViewModel="True"
            x:Name="mainWindow"
            WindowStyle="None" 
            MaxHeight="{StaticResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}}"
            MaxWidth="{StaticResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}}"
        xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
        xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf">
    .....界面代码......
    <Window>
    

      红色为对应得设置属性,思路就是把窗口得最大宽度和最大高度分别绑定屏幕得长宽

  • 相关阅读:
    【Python】格式化输出json
    【flask】处理表单数据
    【flask】使用Flask-WTF处理表单
    【html】合并单元格,并居中显示文本
    testng失败重跑
    Maven安装以及使用
    使用extentreports美化testng报告2,增加监听
    使用extentreports美化报告
    获取在控制台输入命令后的结果
    mysql的慢查询实战+sql优化
  • 原文地址:https://www.cnblogs.com/txb1989/p/15723885.html
Copyright © 2011-2022 走看看