Re: Screen Height/Maximize = False



LOL Mike.

I believe everything you tell me. So be careful, my life's in your hands.
:-0

I moved the taskbar out of the way with the 'hide' setting and didn't see
the statusbar beneath it. But hey, I believe you, I believe you.

So what you are really saying is that I 'cannot' do what I need to do
without becoming a super VB or Windows hacker.

:-)
Rick



"Mike Williams" <Mike@xxxxxxxxxxxxxxxxx> wrote in message
news:du9757$13o$1@xxxxxxxxxxxxxxxxxxxxxx
"WebBiz" <justask@xxxxxxxxxxxxxxxxx> wrote in message
news:vzONf.9835$Tf3.1095@xxxxxxxxxxxxx

I've made the minor changes (back to the old way) so that my status
bar shows up okay now. However, the original problem still exists.
Why does it not show when MaxButton is set to False? In case it was
the Taskbar at the bottom of the window, I set it to Autohide so I can
look behind it. Nope, the status bar isn't behind it either. Strange
problem. Anyone have a clue?

Yep. I've got a clue, Rick. It's exactly as I told you a week or so ago,
although you don't seem to believe me :-(

With your Form's windowstate set to Maximized and its MaxButton set to
False the status bar you are drawing is "underneath the Windows taskbar"
(at least if the Windows taskbar is in its normal "bottom of the screen"
position). Obviously, if it is underneath the Windows taskbar then you
will not be able to see it. The problem happens because VB seems to
misreport the size of the Form to the operating system under such
conditions, and although I haven't delved to deeply into the problem I
think you might need to subclass the Form to fix the problem properly
(although there will of course probably be other ways of working around
the problem). You can see what is happening by performing the following
two tests with the Windows taskbar set to the standard AutoHide OFF and
NOT locked and at the bottom of the screen.

1. Use the status bar code you provided on a Form with its WindowState
set to Maximized and its MaxButton set to True and when you run the code
you will see the statusbar at the bottom of your Form, exactly as you
would expect to.

2. Now set the Form's MaxButton property to False (but leave the
Windowstate set to Maximized). Make sure you double check the state of
these two settings just in case altering one has an effect on the other
(as sometimes happens with certain settings). Now run the code again. This
time you will not see the Form's status bar. But believe me, it IS there
but it is underneath the task bar! You can prove this by hovering the
mouse over the top edge of the Windows taskbar until the pointer turns
into an up/down arrow. Now drag the top edge of the taskbar upwards until
it is quite large, filling perhaps the bottom half or two thirds of the
screen, and then let go of the mouse button. When you release the mouse
button Windows will resize the Maximized Form in its usual way so that the
Form now occupies the available screen area (the screeen area minus the
task bar). At least that is what SHOULD happen, and is what actually does
happen under normal circumstances, but instead (because of the false
reporting by VB under these specific WindowState and MaxButton conditions)
Windows will think that the Form needs to be slightly bigger than it
should be, and your statusbar will be drawn at the bottom edge of this
"wrong size Form", causing the statusbar to be hidden from view behind the
Windows taskbar.

You can definitely prove that this is the case by now hovering the mouse
over the top edge of the Windows taskbar again and this time "dragging the
top edge of the Windows taskbar up and down the screen" while keeping the
mouse button pressed down. You will see your statusbar, and you will see
exactly where it was! As soon as you release the mouse button Windows will
perform its normal task of resizing the Form to its new "maximum" size,
but once again Windows will get it wrong, and will draw your status bar at
the bottom of the Form hidden behind the Windows taskbar. This is because
of a bug in VB which misreports the dimensions under these specific
MaxButton and WindowState conditions. As I've said, you might need to
subclass the Form to fix this bug properly, but there will obviously be
other ways of working around the problem as well.

I see it as a "bug" in VB, but perhaps Micro$haft would prefer to call it
an "undocumented feature"!

Now do you believe me?

Mike




.