convert mm to Pixels?

Hi, does anyone have any idea how to convert mm to Pixels. I use this to let users align labels on a form dynamically, and then save the values in a db.
Cheers
Kev
[173 byte] By [KiwiCoder] at [2007-12-16]
# 1
That would depend on the screen resolution. The pixel per inch (or Pixel per MM in yoru case) changes for each resolution.

You can do 2 things. Because the controls are all saved in Pixel distances, you can save the current Top,Left,height, width of a control into your database, and simply restore those settings.

the other option, would be to save it as a percentage. So if they change their screen resolution, you can always position the control near the same place.

ie, to save the .left of a control, use...

LeftVal = 100 - (((Me.Width - Button1.Left) / Me.Width) * 100)

where ME is the form, and button1 is a sample control.
Just reverse the formula when restoring the values.

Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...