Getting the actual size of my form

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi !

I want my app to fit the desktops boundries (like the
taskbar) you get the available size, calling
Screen.PrimaryDevice.workingArea. That works fine.
But when i set the height of my form to that of the
workingArea it is the menu height to large. So somehow
the menu doesn't cares about the height of the form.
First question, how do i get the height of the menu to
substract it from the actual height of the form.
The second thing is, to determine the actual
drawingRectangle of my form, that mean first without the
menu, okay. But the second thind is that calling
this.ClientRectangle seems not to substract the Window
Caption Bar with the maximizebox and close button.
Second question, how do i get the height of the Forms
Caption Bar.

Thanks for the help,
nick
 
Nick said:
Hi !

I want my app to fit the desktops boundries (like the
taskbar) you get the available size, calling
Screen.PrimaryDevice.workingArea. That works fine.
But when i set the height of my form to that of the
workingArea it is the menu height to large. So somehow
the menu doesn't cares about the height of the form.
First question, how do i get the height of the menu to
substract it from the actual height of the form.
The second thing is, to determine the actual
drawingRectangle of my form, that mean first without the
menu, okay. But the second thind is that calling
this.ClientRectangle seems not to substract the Window
Caption Bar with the maximizebox and close button.
Second question, how do i get the height of the Forms
Caption Bar.

Thanks for the help,
nick


Check out the SystemInformation object...

It has static properties like CaptionHeight and FrameBorderSize, etc.
that are going to give you what you need.

-- TB
 
Back
Top