Form Size and Height

Mark Richardson

Registered User.
Local time
Today, 13:07
Joined
Mar 27, 2003
Messages
24
Really easy one this but how can i set the height and width of my form through vb. I have a form with two buttons and some text, and a whole page looks daft. I just want a small window to open. Not really with it today.
 
Form Height and Width properties
 
Change it to a pop-up?
 
Using the InsideHeight & InsideHeight properties in the forms OnOpen event will
enable you to control the size of your forms. You just need to play around with
the "twips" to get the size you want.

Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
    
'   For testing the size of the form OnOpen
'   MsgBox "InsideHeight = " & InsideHeight & vbCrLf & vbLf & "InsideWidth = " & InsideWidth
    InsideHeight = 4605
    InsideWidth = 7950
    
Exit_Form_Open:
    Exit Sub
    
Err_Form_Open:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Form_Open
    
End Sub
HTH
 

Users who are viewing this thread

Back
Top Bottom