Form size question...

  • Thread starter Thread starter GTi
  • Start date Start date
G

GTi

I have a resizeable form (window) and some controls inside.
When the form resizes I want the controls to follow.
So I use this.panel1.Move to handle the event.
But I need to know the size if the working area of the form.
I have a app. bar, menu and a Status Panel.
I know that this.Height-75 will give me the correct working height,
but this look ugly. What when the user use another app. bar height.

Is there another class to get the correct height AND width of the working
area in a form?
 
You have the Size and ClientSize properties... :

private void Form1_Load(object sender, System.EventArgs e)
{
MessageBox.Show(this.Size.ToString());
MessageBox.Show(this.ClientSize.ToString());
}

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
GTi said:
Is there another class to get the correct height AND width of the working
area in a form?

Can't you use the Anchor settings? WinForms will resize or reposition the
controls for you.

-- Alan
 
Alan Pretre said:
Can't you use the Anchor settings? WinForms will resize or reposition the
controls for you.

-- Alan

Hi Alan,
After playing around with the Anchor settings,
it seems that it is exactly what I want.
Removing the left settings did it.

Thanks!!!
 
Back
Top