01-23-2008, 12:36 PM
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 ?
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.
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.
01-24-2008, 10:27 AM
OK, thanks for the infos :)