userform

  • Thread starter Thread starter Mandy
  • Start date Start date
M

Mandy

I have a userform which is necessarily large.
On some screens at work it is off the bottom of the screen.
Is there anyway to make the userform automatically fit to
the size of the screen, or failing that allowing it to be
manually adjusted by the user using sizing handles?

Many thanks
 
Hi Mandy,
To allow the user to modify the userform size:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Sub UserForm_Initialize()
SetWindowLong FindWindow(vbNullString, Me.Caption), -16, &H84CC0080
End Sub

Regards,
MP
 
Mandy,

Almost all my userforms are too long
to fit on the screen either. I find that
resizing them to fit on the screen is
not very helpful because it makes
the print too small to read comfortably.

What I've done in all instances is
to utilize scroll bars. My users
have uniformly told me that they
prefer scrolling to squinting.

-- Dennis Eisen
 
Back
Top