Changing form height at runtime

Phoenix88
01-23-2008, 12:36 PM
Good day

Seems like if I want to alter a form height at runtime, I have to set it as twip instead of pixel

It's ok with me, but will it works on every user's machine, or some has pixels defined as main scale unit ?

Thanks

JPB
01-23-2008, 02:00 PM
You can get the exact pixels you require regardless of the twips per pixel on the destination device as follows:


Me.Width = mlngPixelsX * Screen.TwipsPerPixelX
Me.Height = mlngPixelsY * Screen.TwipsPerPixelY


Where mlngPixelsX and mlngPixelsY are variables (or constants) with the amount of pixels you require.

dilettante
01-23-2008, 04:45 PM
So the answer is yes. Twips per pixel varies from machine to machine based on DPI settings. My guess is that you'll find most systems are set for 96 DPI. This will probably change more often in Vista, which allows per-application hi-DPI settings to be requested via application manifests.

Note that most displays currently use square pixels, but some can have different X and Y DPI settings.

Phoenix88
01-24-2008, 10:27 AM
OK, thanks for the infos :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum