Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] C# Resizing Forms

Started by CandleJack Jul 6, 2008 at 12:51 PM 3 replies 2.4k views
Original Post
CandleJack
CandleJack
This is probably really stupid and basic but I think I'm missing something with how the resizing and positioning works, and I can't seem to find anything helpful... I've got one control on a form which is positioned at (0, 45) and sized to (137, 601), and a second one which is positioned at (138, 45) and sized to (817, 617). So it seems that their combined width would be 954, but when the form is sized to be 954, they don't quite fit correctly.. This is all done at design time so I'm a little confused. As far as the height goes, I've got a toolbar control docked at the top (0, 0) sized to (948, 44), and the two controls mentioned already right below it. So again it seems the correct height for the form would be 662 but like before, this size cuts off the controls. I would attach a screen shot, but ever since I started using dual monitors I can't seem to capture screen shots anymore for some reason... sigh...
shawnre
shawnre
Are you taking into account the width (border width I believe) of the form?
SamLowry
SamLowry
Strange, no dual screen problems here. Pressing PrintScrn just captures both screens in one big bitmap.

Regarding your problem: are you working with the Size or the ClientSize of the Form? You should be using the latter as it takes into account what's left of the window (i.e. the client area) after subtracting title bar, borders, etc.
shawnre
shawnre
Or, evidentally there is a ClientSize property that you can use.
CandleJack
CandleJack
Thanks, ClientSize worked correctly.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.