Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a workbook that uses a userform to display some help text. (.pdf) I use the "WebBrowser" control to do so. I set a default size of 640 x 480 for the userform. However I would like the user be able to modify the window size the way we usually do: stretching it by the lower right corner. If someone could help me with that challenge, I would appreciate. Thanks Pierre |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Pierre, Add a new VBA module to your project and copy the following code into it. CALLING THE FORM RESIZE CODE: In the UserForm Activate event add the following line... Call MakeFormResizable Code: -------------------- 'API calls and constants ' 'Returns the Window Handle of the Active Window Public Declare Function GetActiveWindow _ Lib "User32.dll" () As Long Private Declare Function GetWindowLong _ Lib "User32.dll" _ Alias "GetWindowLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong _ Lib "User32.dll" _ Alias "SetWindowLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Const GWL_STYLE As Long = (-16) 'The offset of a window's style Private Const WS_THICKFRAME As Long = &H40000 'Style to add a sizable frame Public Sub MakeFormResizable() Dim lStyle As Long Dim hWnd As Long Dim RetVal hWnd = GetActiveWindow 'Get the basic window style lStyle = GetWindowLong(hWnd, GWL_STYLE) Or WS_THICKFRAME 'Set the basic window styles RetVal = SetWindowLong(hWnd, GWL_STYLE, lStyle) End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=495084 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much
Pierre "Leith Ross" a écrit dans le message de ... Hello Pierre, Add a new VBA module to your project and copy the following code into it. CALLING THE FORM RESIZE CODE: In the UserForm Activate event add the following line... Call MakeFormResizable Code: -------------------- 'API calls and constants ' 'Returns the Window Handle of the Active Window Public Declare Function GetActiveWindow _ Lib "User32.dll" () As Long Private Declare Function GetWindowLong _ Lib "User32.dll" _ Alias "GetWindowLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong _ Lib "User32.dll" _ Alias "SetWindowLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Const GWL_STYLE As Long = (-16) 'The offset of a window's style Private Const WS_THICKFRAME As Long = &H40000 'Style to add a sizable frame Public Sub MakeFormResizable() Dim lStyle As Long Dim hWnd As Long Dim RetVal hWnd = GetActiveWindow 'Get the basic window style lStyle = GetWindowLong(hWnd, GWL_STYLE) Or WS_THICKFRAME 'Set the basic window styles RetVal = SetWindowLong(hWnd, GWL_STYLE, lStyle) End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=495084 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
WordArt - stretching | Excel Discussion (Misc queries) | |||
HELP..Stretching on print out | Excel Discussion (Misc queries) | |||
fly wheel on a mouse and a userform | Excel Programming | |||
How to create labels in a UserForm dynamically and be able to resize them with the mouse. | Excel Programming | |||
stretching cells | Excel Programming |