window size

G

Graeme Richardson

Hi, I'm trying to determine the size of the working area so that I can
maximize a form in the available area and place controls at the bottom of
the maximised form.

The code is running in the initialisation phase. I hide the form until the
initialisation code is complete.
I know the screen size is 320 x 240.
How can I determine if the task bar is visible and how tall it is?
How can I determine the height of a Window's title bar?

From experiement:
The statement
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height
returns 214 with task bar visible and 235 without.
I can guess that the title bar is about 24 high.

Thanks, Graeme
 
D

Daniel Moth

See if .ClientRectangle & .ClientSize are what you are looking for (they are
members of Control inherited by Form)

Cheers
Daniel
 
N

Neville Lang

Graeme,

I know that the TaskBar height at the top is 26 pixels and the MenuBar (plus
ToolBar and SIP) at the bottom is also 26 pixels.

Regards,
Neville Lang
 
M

Michael Lipp [MSFT]

You can also use SystemInformation.MenuHeight for this.

I primarily use this to to programatically adjust my UI on Windows CE
devices where the native OS puts the menus inside the client area of your
form.

mike
 

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

Similar Threads


Top