Is it a good idea to dynamically position and size controls on a form or statically set them?

Posted by CrystalBlue on Programmers See other posts from Programmers or by CrystalBlue
Published on 2011-02-28T22:05:15Z Indexed on 2011/02/28 23:33 UTC
Read the original article Hit count: 196

Filed under:
|

I've worked mostly with interface building tools such as xCode's Interface Builder and Visual Studio's environment to place forms and position them on screens. But I'm finding that with my latest project, placing controls on the form through a graphical interface is not going to work. This more has to do with the number of custom controls I have to create that I can't visually see before hand.

When I first tackled this, I began to position all of my controls relative to the last ones that I created. Doing this had its own pros and cons. On the one hand, this gave me the opportunity to set one number (a margin for example) and when I changed the margin, the controls all sized correctly to one another (such as shortening controls in the center while keeping controls next to the margin the same). But this started to become a spiders-web of code that I knew wouldn't go very far before getting dangerous. Change one number and everything re sizes, but remove one control and you've created many more errors and size problems for all the other controls. It became more surgery then small changes to controls and layout.

Is there a good way or maybe a preferred way to determine when I should be using relative or absolute positioning in forms?

© Programmers or respective owner

Related posts about design

Related posts about user-interface