首页 > 其他分享 >WPF window fill the full screen and overlap on the taskbar

WPF window fill the full screen and overlap on the taskbar

时间:2024-09-23 22:23:32浏览次数:7  
标签:full Windows screen System overlap Window window using MainWindow

 WindowState="Maximized"
 WindowStyle="None"

 

 

 

<Window x:Class="WpfApp409.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:WpfApp409"
        mc:Ignorable="d"
        WindowState="Maximized"
        WindowStyle="None"
        KeyDown="Window_KeyDown"
        Title="MainWindow" Height="450" Width="800">
    <Window.Background>
        <ImageBrush ImageSource="/Images/1.jpg"/>
    </Window.Background>
    <Grid>
        
    </Grid>
</Window>


//cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApp409
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if((Keyboard.Modifiers == ModifierKeys.Control) && e.Key == Key.C)
            {
                var msgResult=MessageBox.Show("Are you sure to close the window?","Close Window",MessageBoxButton.YesNo,
                    MessageBoxImage.Question, MessageBoxResult.Yes);
                if(msgResult == MessageBoxResult.Yes)
                {
                    this.Close();
                }
            }
        }
    }
}

 

标签:full,Windows,screen,System,overlap,Window,window,using,MainWindow
From: https://www.cnblogs.com/Fred1987/p/18428045

相关文章

  • Win11系统提示找不到ScreenClipping.dll文件的解决办法
    其实很多用户玩单机游戏或者安装软件的时候就出现过这种问题,如果是新手第一时间会认为是软件或游戏出错了,其实并不是这样,其主要原因就是你电脑系统的该dll文件丢失了或没有安装一些系统软件平台所需要的动态链接库,这时你可以下载这个ScreenClipping.dll文件(挑选合适的版本文件......
  • Linux 后台运行服务的全攻略:nohup、screen、tmux 和 systemd 的实战指南
    Linux后台运行服务的全攻略:nohup、screen、tmux和systemd的实战指南在服务器运维或后台开发中,保持服务在后台稳定运行是一项非常重要的需求。无论是开发阶段还是生产环境,确保服务在终端关闭后持续运行是保证服务可用性的关键。本文将详细介绍几种常见的后台运行服务的......
  • 【MySQL】查询语句之inner、left、right、full join 的区别
     前言:    INNERJOIN和OUTERJOIN是SQL中常用的两种连接方式,用于从两表活多表中提取相关的数据。两者区别主要在于返回的结果集如何处理匹配与不匹配的行。目录1、INNERJOIN2、OUTERJOIN3、总结1、INNERJOIN    称为内连接,只有查询的几......
  • Blender天空预设增强插件:Pure-Sky Pro V6.0.84 Full Pack
    可以在Blender中模拟真实的天空效果,支持Eevee和Cycle渲染器Imagineabeautifulstarryskyonafullmoonnight,asunsetattheseasideorabeautifulsunnyday,withPure-SkyProyoucannowrealizethesedifferentscenesandmuchmore.Blender插件功能多......
  • `FULL JOIN` 和 `UNION ALL`
    在SQL中,`FULLJOIN`和`UNIONALL`是两种不同的操作,它们的结果也有显著的区别。###FULLJOIN`FULLJOIN`(全外连接)会返回两张表中所有的记录。对于没有匹配的记录,结果中会用`NULL`填充缺失的部分。具体来说:-如果表A和表B中有匹配的记录,这些记录会合并在一起。-如果......
  • 【0326】Postgres内核之 VACUUM (FULL)构建所有要 VACUUM 的 relation(s) list(17)
    上一篇:【0325】Postgres内核之VACUUM(FULL)创建BufferAccessStrategyobject(16)1.构建vacuum关系表(reltaions)List在上一篇文章中讲解了Postgres内核创建缓冲区策略对象,之后初始化给全局指针变量vac_strategy。接下来Postgres将通过vacuum()函数的参数,以确认用户......
  • crontab on raspberry pi, full path, not relative path, is needed.
    Sources: https://forums.raspberrypi.com/viewtopic.php?t=296993 thanksthagrol,thanksRaTTuS,youareright.Igetwrong.10****reboot->isnotrebootin10min.Itisnexthouratminute10reboot*/10****reboot->itisrebbotin10minB......
  • [Typescript] Toggle full screen
    constrequestFullscreenProps=["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullScreen",]asconst;constexitFullScreenProps=["exitFullscreen","......
  • How to use Node.js to get all files full paths that nested in folders All In On
    HowtouseNode.jstogetallfilesfullpathsthatnestedinfoldersAllInOne如何使用Node.js获取文件夹中嵌套的所有文件的完整路径demosESM//❌//importfsfrom'node:fs/promises';//✅import*asfsfrom'node:fs/promises';//import*asfsf......
  • HarmonyOS沉浸式模式FullScreen
    import{window}from'@kit.ArkUI'classFullScreen{//开启全屏asyncenable(){constctx=AppStorage.get<Context>('context')!constwin=awaitwindow.getLastWindow(ctx)win.setWindowLayoutFullScreen(true)//顶部安全区......