Share via

Resize VBA userform

Anonymous
2016-08-01T17:32:14+00:00

I want to make a resizable userform. Right now below is the code but it only minimize and maximize.

Private Sub UserForm_Activate()

Dim lFormHandle As Long, lStyle As Long

lFormHandle = FindWindow("ThunderDFrame", frmTesting.Caption)

lStyle = GetWindowLong(lFormHandle, GWL_STYLE)

lStyle = lStyle Or WS_SYSMENU 'SystemMenu

lStyle = lStyle Or WS_MINIMIZEBOX 'With MinimizeBox

lStyle = lStyle Or WS_MAXIMIZEBOX 'and MaximizeBox

SetWindowLong lFormHandle, GWL_STYLE, (lStyle)

DrawMenuBar lFormHandle

End Sub

Is it possible to custom resize the userform?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2016-08-02T07:13:59+00:00

    Is it possible to custom resize the userform?

    Here is a sample file:

    https://dl.dropboxusercontent.com/u/35239054/Userform_Example_FormResizer.xlsm

    Andreas.

    Was this answer helpful?

    0 comments No comments