Making a form 100% of screen height & width

  • Thread starter Thread starter Xool
  • Start date Start date
X

Xool

Hi

Can anyone tell me how do I make my form 100% of the screen height and width

Cheers
 
Hi

Try

Private Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
End Sub


OR


Private Sub UserForm_Initialize()
Me.Height = Application.UsableHeight
Me.Width = Application.UsableWidth
End Sub

***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
Brilliant, thanks for your speedy reply



Dave Hawley said:
Hi

Try

Private Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
End Sub


OR


Private Sub UserForm_Initialize()
Me.Height = Application.UsableHeight
Me.Width = Application.UsableWidth
End Sub

***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
Try this in the form mcode module :

' ----------------------------------------------
'- Declaration top of module
Private Declare Function GetSystemMetrics _
Lib "user32" (ByVal nIndex As Long) As Long
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
'------------------------------------------------
'-
Private Sub UserForm_Initialize()
x = GetSystemMetrics(SM_CXSCREEN)
y = GetSystemMetrics(SM_CYSCREEN)
Me.Top = 0
Me.Left = 0
Me.Width = x * 0.75
Me.Height = y * 0.75
End Sub
'------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top