Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximized form goes behind taskbar, rather than resizing

Status
Not open for further replies.

perplexd

Programmer
May 9, 2002
154
US
I have a form, on which I have set the property WindowState to 2-Maximized.

However when you change the state of the taskbar eg to AutoHide or make it larger/smaller, the size of the maximized form does not change to compensate. Whatever the state of the toolbar, the form takes up the entire screen.

How do I get the form to resize?

Thank you in advance.
 
I have a form where I set the same property to then same setting and I have no problems when the task bar is set to always on top, regardless of the width of the taskbar. With my form maximized I removed the auto hide and my form resized properly. If you have autohide checked then I don't think that your form is suppose to resize because the taskbar is placed on top of your form and not below it. When the task bar loses focus it then disappears.

OK I am rambling now, maybe I don't understand your problem. You can check to see if you are not hard coding the size of your form when it is loaded or resized with a me.height=??? line.

It could also be a windows issue and not a VB issue.

Hope this is helpful. Thanks and Good Luck!

zemp
 
What OS? If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]
 
Its running on Windows 2000.

Other developers have had problems with it before though because it is a standard company image - ie not exactly Windows 2000 (this is what I'm told). However I doubt that has anything to do with this resizing problem.

Zemp: how do you mean harcode the size of your form? If you mean do I have lines of code stating specific sizes for objects then no. However, the objects on the form are a fixed size and in fixed positions - done at design-time.
 
Sorry for being unclear, but I think you understood. I meant do you have code such as 'form1.height=8000' in the resize event or elsewhere.

FYI, I am running Windows 2000 as well. You have an interesting problem, sorry I'm not much help. Thanks and Good Luck!

zemp
 
That behavior is by design. VB does no automatic resizing for you. As a matter of fact, the most I've seen any MS app do is adjust the height of the "area" in the middle and move up controls underneath, like the IE browser, but that is coded into the application. Maximized uses Screen.Height and Width not the WorkingArea Size, i.e. that area not occupied by fixed Taskbar and toolbars, like the Office Toolbar. Also realize that the Taskbar can be on any edge, not just the bottom. Just hold down the left mouse button on a clear area of the Taskbar and drag it. Checkout the Systinfo control which can give you the current Working area dimensions, but will not do any resizing. Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top