Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created application using WinForm.I have set the window state maximised.
When i run the program the window is behind the taskbar and the status bar does not display.How can I have to program to be maximized, but the taskbar remains?
Posted
Updated 19-Jul-21 4:22am
v2
Comments
Sergey Alexandrovich Kryukov 10-Apr-13 13:34pm    
You would need to make a minimal code sample to reproduce just this problem and nothing else. Remove SQL and Server2008 tags and don't mention it in code as irrelevant. Use "Improve question".
—SA

Using Google search with keywords windowstate maximized hides taskbar, I found this article that explains that this is a problem with WPF. Are you using WPF? You didn't say.

See Maximizing window (with WindowStyle=None) considering Taskbar[^]

The article says that the problem only occurs when WindowStyle = None.
I suggest that you try setting the WindowStyle = SingleBorderWindow for your form to see if that solves it.
 
Share this answer
 
You can do that by adding code in the Form Load Event of WindowsForm

private void Form1_Load(object sender, EventArgs e)
   {
       this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea;
       this.WindowState = FormWindowState.Maximized;
   }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900