GUI & System DPI Settings...

edb
03-13-2004, 10:41 PM
Sorry, posting this here... EVERYTHING I've EVER posted in the "GUI Section" never gets replied to.

Is there a standard way of maintaining a form's appearance (layout, size, etc.) regardless of the system's DPI settings? For instance, if I design a form on my system using "Normal Fonts" (or 96 DPI) and run it using "Large Fonts" (or 120 DPI), most of the controls are distorted and have changed in position and size!

How do I correct this issue so that I can create ONE form, which will be visible correct regardless of these settings? Right now, I have the app detect the twips-per-pixel state, and load a form (one for 96 DPI, the other designed for 120 DPI). Surely I don't have to keep creating 2 seperate forms for each setting, do I?

passel
03-14-2004, 04:23 PM
I don't think there is a "standard" way. There are 3rd party controls, I think, to help with this. The problem is despite how you specify the Scalemode of the controls, the size of all controls is stored in the .frm file in twips. And the number of twips per pixels changes with the DPI setting, so your controls will change size and position (relative to their original sizes and position in pixels). About the only way to compensate, is to have code to size and position the controls, in the Form_Load (i.e. convert the Form's dimensions to pixels, and if it doesn't match the size you wanted, then resize it so that you have the client size (in pixels) that you originally had. You would then resize and position all the controls as well. A lot of work. Maybe having two forms is not such a bad option.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum