this.MaximizeBox (enable/ disable)

  • Thread starter Thread starter Tim Bücker
  • Start date Start date
T

Tim Bücker

Hello.

I have a form with some controls on it. One of these controls is a button
that disables/ enables all the other controls.
The form itself should also be "disabled/enabled", so I set
this.FormBorderStyle = FormBorderStyle.Sizable;
to "enable" and
this.FormBorderStyle = FormBorderStyle.Fixed3D;
to "disable" the form (no resize).

Doing it like this everything is ok. But unfortunately I also want that the
maximize button in the upper right corner to be disabled, so I also set the
MaximizeBox property. And here comes the problem:

Minimizing the form, the taskbar is overlapped - not anymore visible - by my
form when beeing activated again!!!
What can cause such a strange behavior? I am really thankful for any
thoughts and comments.

Greetings and thanks in advance,
Tim.
 
Tim Bücker said:
Minimizing the form, the taskbar is overlapped - not anymore visible - by my
form when beeing activated again!!!
What can cause such a strange behavior? I am really thankful for any
thoughts and comments.

I think I see what you mean -- when I *maximize* the form and /then/
disable the maximize box (actually, the maximize box is now the *restore*
box, because the form is now maximized), the form stays on top of the
taskbar, even though my taskbar is set to stay on top of other windows.
This didn't happen if the form wasn't maximized at the time that
MaximizeBox was set, however.

Is this the problem that you observed?

Also, if I then double-click the form's border (equivalent to clicking an
enabled restore button), the form seems to restore again, and then resize
itself. Once this happens, the form doesn't stay on top of the taskbar
anymore.

I suppose that this is a bug, but I don't think that disabling the restore
button on a maximized form is a good idea at all.
 

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

Back
Top