There is a program window, there is a button in it that puts the program window in full-screen mode. When you press Esc, the program is transferred to windowed mode. Everything is done as in the documentation. When you press the button:

this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; this.TopMost = true; 

When you press Esc:

  this.FormBorderStyle = FormBorderStyle.Sizable; this.WindowState = FormWindowState.Normal; this.TopMost = false; 

I will say right away that everything works, but there is 1 problem. When I transfer to full-screen mode from the window state - everything is fine, the program covers the entire screen along with the Start menu. When I translate into full-screen mode from an expanded state, the program cannot hide the Start menu and eventually shifts up. Of course, I could use WinApi to set a command to hide the start menu. But just if everything from the window is normal, why is it not happening from the deployed? Tell me what the problem is?

  • Hm In your expanded state, WindowState already equal to FormWindowState.Maximized , so this part may not work as well. Maybe try to change it to Normal and then again to Maximized ? - VladD
  • For sure! You were right. Thank! - Dominik
  • Great, then I will transfer in response. // You are welcome! - VladD

1 answer 1

In your deployed state, the WindowState already equal to FormWindowState.Maximized , so this part may not work that way.

Try changing it to Normal first and then to Maximized again.