Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleSet a form's size in inches
Keywordsform, size, inches
CategoriesTips 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
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated