全屏模式,但不要覆盖任务栏 [英] full screen mode, but don't cover the taskbar

查看:448
本文介绍了全屏模式,但不要覆盖任务栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WinForms应用程序,该应用程序在登录时设置为全屏模式。

I have a WinForms application, which is set to full screen mode when I login.

我的问题是它也涵盖了Windows任务栏。我不希望我的应用程序覆盖任务栏。

My problem is it's covering the Windows taskbar also. I don't want my application to cover the taskbar.

这怎么办?

推荐答案

这可能就是您想要的。

This is probably what you want. It creates a 'maximized' window without hiding the taskbar.

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load( object sender, EventArgs e )
    {
        FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        Left = Top = 0;
        Width = Screen.PrimaryScreen.WorkingArea.Width;
        Height = Screen.PrimaryScreen.WorkingArea.Height;
    }
}

这篇关于全屏模式,但不要覆盖任务栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆