Form's ClientSize

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
When using the Form's ClientSize property I already know that it does not include the MainMenu (if there is one) but what about the status bar?

I have a form with a MainMenu (at the top) and a StatusBar (at the bottom) and I have menu items representing screen resolution sizes. When the user selects a resolution size (let's say 800x600) I have the form re-sizing itself so the inside of the form (ClientSize) is now at 800x600 and I need to make sure it does not include any menus or the statusbar

I read the MSDN topic on Form's ClientSize but it does not state whether statusbars are included, my tests of this shows that a statusbar is included in the ClientSize in which I will need to code around this so the statusbar is not included.

Any ideas?
 
This is what I read for ClientSize:
The size of the client area of the form is the size of the form excluding the borders and the title bar. The client area of a form is the area within a form where controls can be placed.
That said, my test show ClientSize also exclude MainMenu. StatusBar does not affect ClientSize. As a kind of defense for these documentation statements we could say the MainMenu can't be placed in the forms Controls collection, it is a component and not a control and can only be assigned the forms Menu property. The Statusbar is a control and can be placed anywhere within ClientSize.

It sounds strange to change the interior of form to fit a screen resolution, making the form exterior (Size property) not fit the regular desktop of the resolution. To fit a screen resolution you would normally make the form DesktopBounds equal to the Screen.WorkingArea.
 
yes, that does sound weird, however the app that I'm building is to allow you to open a program within my program so that you can see how the program runs (looks) at different resolutions

here's the main idea for this:
You're a web developer and of course you know people will be loading your website in various web browsers and those people also have varying screen resolutions. Your development computer you're running a screen resolution of 1600x1200 or higher and the site you're building this for is supposed to work between 800x600 and 1280x1024 with IE6/7 and Firefox 1.5+ so you run my program and open IE within it with your website loaded. Now you simply select the screen resolution of my program to the one you want the website to be displayed at. It's a development tool.
 
I see, I've always used a wallpaper with the different resolutions drawn up for that.. :)
 
that works too, I'm more so making this app to gain experience with handling other programs from within a vb.net program really and if anyone else finds this app helpful then I'm helping more people than just myself

I'm planning on posting the source code to the project on this forum when it's as complete as I'm going to make it so other people can expand upon it
 
Sounds like a good exercise for learning.

I use Firefox's Web Developer Toolbar to resize Firefox.
You can launch IE at various resolutions using Visual Studio.
 
Back
Top