window size

  • Thread starter Thread starter Graeme Richardson
  • Start date Start date
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
 
See if .ClientRectangle & .ClientSize are what you are looking for (they are
members of Control inherited by Form)

Cheers
Daniel
 
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
 
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
 
Back
Top