Ranjan Sakalley

Sponsors

The Lounge

News

  • CodeBetter.Com Home



    I'm test-driven!



Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Dialog Units
Microsoft recommends a left margin of 7 Dialog Units (DLUs) (here) between controls in forms. So what is this DLU?
The definition follows -
 A vertical dialog unit equals 1/8 the font height, and a horizontal dialog unit equals 1/4 the font width.

The actual problem is,  when we talk about the system font above, how do we design a form, for a variety of possible font sizes and system resolutions, on the dev machine? Should we keep the measurements dynamic or is there a way to mandate the sizes in DLUs, rather than pixels?




Posted 04-11-2006 5:35 AM by rsakalley
Filed under:

[Advertisement]

Comments

Jay R. Wren wrote re: Dialog Units
on 04-11-2006 10:09 AM
This is an excellent question.  I think the answer lies in that software form designers today should only be used for quick and dirty mock ups, or forms that only have to work in very specific situations.  

Purhaps the form designers of tomorrow will by default snap to DLUs rather than pixels.  Indeed even form sizes should not be static but rather be in DLUs.  Maybe Expression will have these options, and the ability to toggle through all fonts on a form in both type and size.  Maybe ctrl-scrollwheel would just change everything so one can quickly examine all these changes.  That would be great.
rsakalley wrote re: Dialog Units
on 04-11-2006 3:12 PM
Jay,

Exactly what I was thinking about, and actually we might be critical of Visual Studio Form Designer and the Winforms class library, which should provide size specification in DLUs. Might as well write a decorator and a runtime engine to make this happen.

Thanks,
r.
Sanjeevakumar Hiremath wrote re: Dialog Units
on 06-25-2006 2:20 PM
Hi Ranjan,

In Windows forms (.NET 1.1) form has these two properties to control the size and spacing of the controls whenever the system font changes. These make sure the DLUs are maintained.

AutoScale
AutoScaleBaseSize

Where as the form in Windows forms (.NET 2.0) has these two properties to achieve the same.

AutoScaleMode
AutoSizeMode

Sanjeeva.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?