Maximized form questions

1

1388-2/HB

For vb2005. At design time I set the main form's WindoState to Maximized
and I disabled the Maximize box. The user can Minimize the application
only.

When the program launches, the form is indeed Maximized. However:

1. The Maximized state of my form does not take the Windows taskbar state
into consideration. The form behaves as if the user has their taskbar set
to "autohide", even if they do not. The app extends all the way down to the
bottom of the screen, and on some machines the lower bounds of this area may
be obscured by the taskbar permanently set in the 'raised' position. Is
there a Maximize command that understands to account for the state of the
windows taskbar?

2. You can simply grab the title bar of my "Maximized" form and move it
around, as if it were a normal window that is not Maximized. Is there a way
to "lock" a Maximized window in place?

3. Double-clicking the title bar of my application performs a "restore
down", circumventing my disabled the maximize/restore button. Subsequently
double-clicking the application title bar does not "restore up" again, and
so the app is left stranded in a restore-down (shrunken) state that is a)
not desireable in the first place and b) irrecoverable unless the app is
restarted. Is there a way to disable the double-clicking of a title bar
from performing a restore down?
 
S

Shane Story

1.) Screen.GetWorkingArea() get's the non taskbar working area, you could
dimension your form to this.
2.) Why don't you start it out as maximized, in the windowstate property.
If this doesn't work have you considered getting rid of the title bar? You
could always add your own minimize button and that would avoid the user
being able to move it. This is sort of an irritating behavior, but it is
your app.
This would solve item #3
3.) Otherwise, if you want to circumvent restore down, I think you
would probably need to do Sub classing, although I am curious, if you set
MaximumSize & MinimumSize properties based on the value in #1 above, maybe
it wouldn't allow this.

HTH,

Shane
 

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