Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 999773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:24:24+00:00 2026-05-16T07:24:24+00:00

I have a WinForms application. Application has menustrip, toolstrip and several panels. I want

  • 0

I have a WinForms application.

Application has menustrip, toolstrip and several panels.

I want to stretch one of that panels on fullscreen. I want that panel covers all screen include taskbar.

How do I do it ?

============================================

I used an answer of Hans Passant:

public partial class Form1 : Form
{
    Size _panel1Size;

    public Form1()
    {
        InitializeComponent();

        _panel1Size = panel1.Size;
    }

    void bFullScreen_Click(object sender, EventArgs e)
    {
        this.FormBorderStyle = FormBorderStyle.None;
        this.WindowState = FormWindowState.Maximized;
        this.panel1.Size = this.ClientSize;
    }

    void bGoBack_Click(object sender, EventArgs e)
    {
        this.FormBorderStyle = FormBorderStyle.FixedDialog;
        this.WindowState = FormWindowState.Normal;

        panel1.Size = _panel1Size;
    }
}
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:24:25+00:00Added an answer on May 16, 2026 at 7:24 am

    Getting a form to cover the taskbar requires it to be borderless. You’ll need to detect the window state change in the OnResize event. Something like this:

    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
            panel1Size = panel1.Size;
            prevState = this.WindowState;
        }
        private Size panel1Size;
        private FormWindowState prevState;
    
        protected override void OnResize(EventArgs e) {
            if (prevState != this.WindowState) {
                prevState = this.WindowState;
                if (this.WindowState == FormWindowState.Maximized) {
                    this.FormBorderStyle = FormBorderStyle.None;
                    panel1.Size = this.ClientSize;
                }
                else if (this.WindowState == FormWindowState.Normal) {
                    this.FormBorderStyle = FormBorderStyle.Sizable;
                    panel1.Size = panel1Size;
                }
            }
            base.OnResize(e);
        }
    
        private void button1_Click(object sender, EventArgs e) {
            this.WindowState = FormWindowState.Normal;
        }
    }
    

    There’s a flaw, it won’t restore to the exact same size. No easy fix for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winforms application that has one tabcontrol with 2 pages. On both
I have a .net WinForms 2.0 application that has an image library of about
One of our clients has an old WinForms application that contains forms with a
I have a WinForms application (VS 2008, .NET 3.5) that has a form with
I have a WinForms application which has two panels which individually contain a usercontrol
I have a C# WinForms application that has a WebBrowser control inside of it.
I have a TreeView control in my WinForms .NET application that has multiple levels
We have a winforms appliction that has to talk to an AS400. To do
I have a Winforms application (written in C#) that is deployed on a network
I have a winforms application and I am trying to create a method that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.