Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
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-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated