|
|
Title | Set a form's size in inches |
Keywords | form, size, inches |
Categories | Tips and Tricks, Controls |
|
|
Use ScaleX and ScaleY to convert the size into Twips. Use the form's current Width, Height, ScaleWidth, and ScaleHeight properties to allow room for the borders and menu bar.
|
|
Public Sub SetFormSizeInInches(ByVal frm As Form, ByVal wid _
As Single, ByVal hgt As Single)
' Convert into twips. Add room for the border.
frm.Width = wid * 1440 + frm.Width - _
frm.ScaleX(frm.ScaleWidth, frm.ScaleMode, vbTwips)
frm.Height = hgt * 1440 + frm.Height - _
frm.ScaleY(frm.ScaleHeight, frm.ScaleMode, vbTwips)
End Sub
|
|
|
|
|
|