CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Ranjan Sakalley


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?




Published Apr 11 2006, 05:35 AM by rsakalley
Filed under:

Comments

Jay R. Wren said:

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.
# April 11, 2006 10:09 AM

rsakalley said:

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.
# April 11, 2006 3:12 PM

Sanjeevakumar Hiremath said:

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.
# June 25, 2006 2:20 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!