Window resizing

  • Thread starter Thread starter No One
  • Start date Start date
N

No One

I have a Window that I would like to "grow" on the basis of the number
and size of controls that are placed inside. The configuration is read
from an XML file and controls are built. The are the correct spacing
from the left side, but not the top of the window. So far, I can get
the client area to resize correctly and scrollbars will show up when
needed (the maximun window sizes is a setting in the XML file), but I
cannot get the window to resize correctly, especially along the right
side of the controls. There is a gutter setting for the amount of space
that is to be to the left and right side of all the controls. The left
side is fine, but the rigth side is not. I set the width of the window
to be gutter + widest control + gutter, but the window width is not
correct.

Also, how do I read the size of the menu bar at the top?

thanks.
 
No One,

Are you using the Height and the Width properties (or the Size
property)? If so, you might want to consider the ClientSize property. This
is the size of the area in the dialog that your controls are placed on, not
including borders, menus, title bars, etc, etc.

Hope this helps.
 
I have tried the Size(), ClientSize() and SetClientCoreSize(). The client area
resizes ok, but the window does not.

Nicholas Paldino said:
No One,

Are you using the Height and the Width properties (or the Size
property)? If so, you might want to consider the ClientSize property. This
is the size of the area in the dialog that your controls are placed on, not
including borders, menus, title bars, etc, etc.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

No One said:
I have a Window that I would like to "grow" on the basis of the number
and size of controls that are placed inside. The configuration is read
from an XML file and controls are built. The are the correct spacing
from the left side, but not the top of the window. So far, I can get
the client area to resize correctly and scrollbars will show up when
needed (the maximun window sizes is a setting in the XML file), but I
cannot get the window to resize correctly, especially along the right
side of the controls. There is a gutter setting for the amount of space
that is to be to the left and right side of all the controls. The left
side is fine, but the rigth side is not. I set the width of the window
to be gutter + widest control + gutter, but the window width is not
correct.

Also, how do I read the size of the menu bar at the top?

thanks.
 

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

Back
Top