MatthewSot
MatthewSot

Reputation: 3594

Completely Maximized C# WinForm

Is there a way to make the C# form completely covers the whole screen? I would be doing this without explorer.exe running, if that makes it easier. I don't want it to be full screen, because I want other programs to be able to run above it. Thanks!

Upvotes: 0

Views: 2205

Answers (1)

Bala R
Bala R

Reputation: 109027

  private void frm_Load(object sender, EventArgs e)
  {
    ControlBox = false;
    FormBorderStyle = FormBorderStyle.None;
    WindowState = FormWindowState.Maximized;
  }



private void frm_KeyDown(object sender, KeyEventArgs e)
  {
    // restore form on Escape key press.
    if (e.KeyCode == Keys.Escape)
    {
      ControlBox = true;
      FormBorderStyle = FormBorderStyle.Sizable;
      WindowState = FormWindowState.Normal;
    }
  }

Upvotes: 4

Related Questions