Design dialog for various resolutions without switching to that resolution
-
I'm trying to make a dialog that fits on screen resolutions 800*600 and up. My resolution is 1600*1200. When I was originally designing my dialogs I foolishly assumed that the number Visual Studio gives in the lower right hand corner is the size of the dialog in pixels, so I designed it to be less than 700. Lo and behold, it's way too big for an 800*600 resolution. How the heck do I know what numbers to keep the size under? Thanks, Jay
-
I'm trying to make a dialog that fits on screen resolutions 800*600 and up. My resolution is 1600*1200. When I was originally designing my dialogs I foolishly assumed that the number Visual Studio gives in the lower right hand corner is the size of the dialog in pixels, so I designed it to be less than 700. Lo and behold, it's way too big for an 800*600 resolution. How the heck do I know what numbers to keep the size under? Thanks, Jay
Dialogs are measured in DLUs, dialog units. The size of a dialog unit is dependent on the size of the system font. The idea is that dialogs should keep their relative size no matter what system font is used. The easiest way to make sure a dialog fits at the minimum supported resolution is simple - switch your graphics card to this resolution, draw a dialog box, then use this dialog box as a maximum-size template for all the other boxes. You can find info on DLUs on MSDN, search for
GetDialogBaseUnits
.