2 different kinds of Maximize?

  • Thread starter Steve C. Orr [MVP, MCSD]
  • Start date
S

Steve C. Orr [MVP, MCSD]

When I have a standard windows forms Form, and I maximize it, it behaves
just like you'd expect.
It fills the screen, except for my taskbar down at the bottom of the screen
(which has standard settings. The taskbar is locked, marked as keep on top
of other windows, and set to not auto-hide.)

When I have a windows form without a title bar though, and I maximize it, it
fills the ENTIRE screen and the taskbar is not visible.

I want to have a windows form without a title bar that maximizes but leaves
the taskbar visible. Is this possible? How?

Thanks,
Steve
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Steve,

This is the way windows works. If the client rectangle is big enough to
cover the screen and the state of the window is maximized. windows hides the
taskbar an makes your application to fill the whole screen so called "full
screen mode".

If you want this not to happen you shold keep te size of the form in
maximized state little bit smaller

For test in the form constructor put those line after InitilizeContro call

Rectangle rect = Screen.FromControl(this).Bounds;
rect.Inflate(0,-1);
this.MaximizedBounds = rect;

If you decide to go with that solution keep in mind that the form can be
moved between desktops, which can have different sizes. Hence having that
code in the constructor is not a good idea.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top