Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Multi Page User Form that I need to be able to resize according to
Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
UserForms have Top, Left, Width and Height properties that allow you to
position and size them with code during the initialize event. All are measured in pixels so: Private Sub UserForm_Initialize() With Me .Top = 25 .Left = 25 .Height = 500 .Width = 800 End With End Sub The above would take up most of the screen. But it is only an example of how to use it. "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried it. I see how to adjust the height and width, but the others i didn't
see any change. Thiis adjust the Outer Main User Form Window, but the User Form is still the same size. Is there a way to automate this process to adjust both? ..Top = Adjust what? I changed it but nothing happens ..Left = Adjusts What? I changed it but nothing happens ..Height = Adjusts the User Form Window Height ..Width = Adjusts the User Form Window Width "JLGWhiz" wrote: UserForms have Top, Left, Width and Height properties that allow you to position and size them with code during the initialize event. All are measured in pixels so: Private Sub UserForm_Initialize() With Me .Top = 25 .Left = 25 .Height = 500 .Width = 800 End With End Sub The above would take up most of the screen. But it is only an example of how to use it. "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thiis adjust the Outer Main User Form Window, but the User
Form is still the same size. Is there a way to automate this process to adjust both? I'm not sure what you are saying or asking here. Do you want to increase the size of the controls on the userform as well? Are you expecting the spacing between controls to adust? What? At any rate, I believe that to get any other results each individual object would have to be addressed. "Brian" wrote in message ... I tried it. I see how to adjust the height and width, but the others i didn't see any change. Thiis adjust the Outer Main User Form Window, but the User Form is still the same size. Is there a way to automate this process to adjust both? .Top = Adjust what? I changed it but nothing happens .Left = Adjusts What? I changed it but nothing happens .Height = Adjusts the User Form Window Height .Width = Adjusts the User Form Window Width "JLGWhiz" wrote: UserForms have Top, Left, Width and Height properties that allow you to position and size them with code during the initialize event. All are measured in pixels so: Private Sub UserForm_Initialize() With Me .Top = 25 .Left = 25 .Height = 500 .Width = 800 End With End Sub The above would take up most of the screen. But it is only an example of how to use it. "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Brian, I tested this and it might suit your puirpose more that the
previous code. Private Sub UserForm_Initialize() Me.Height = Application.UsableHeight Me.Width = Application.UsableWidth End Sub "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tried it too. 1/3 of the User Form is cut off.
How can I get the Min/Max Buttons on the User Form? "JLGWhiz" wrote: Hi Brian, I tested this and it might suit your puirpose more that the previous code. Private Sub UserForm_Initialize() Me.Height = Application.UsableHeight Me.Width = Application.UsableWidth End Sub "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? . |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Afraid the max/min buttons are beyond my programming expertise. There are
no ready-made controls to put them on a UserForm that I know of. It might be possible with some advanced programming to go into the source code and extract the icons and functions to do it, but I am not that astute. "Brian" wrote in message ... Tried it too. 1/3 of the User Form is cut off. How can I get the Min/Max Buttons on the User Form? "JLGWhiz" wrote: Hi Brian, I tested this and it might suit your puirpose more that the previous code. Private Sub UserForm_Initialize() Me.Height = Application.UsableHeight Me.Width = Application.UsableWidth End Sub "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? . |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I bet if you thought about it you could do it. I have a fear of the unknown,
so API setting are intimadating to me, but I am sure you at lease know what they are and how they can effect your computer. I am not that good at this VBA stuff yet, but I am learning more and more everyday thanks to some excelent help from people like yourself. You guys really have a good grasp on this stuff. I want to thank you for all your help. "JLGWhiz" wrote: Afraid the max/min buttons are beyond my programming expertise. There are no ready-made controls to put them on a UserForm that I know of. It might be possible with some advanced programming to go into the source code and extract the icons and functions to do it, but I am not that astute. "Brian" wrote in message ... Tried it too. 1/3 of the User Form is cut off. How can I get the Min/Max Buttons on the User Form? "JLGWhiz" wrote: Hi Brian, I tested this and it might suit your puirpose more that the previous code. Private Sub UserForm_Initialize() Me.Height = Application.UsableHeight Me.Width = Application.UsableWidth End Sub "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? . . |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is some code with a user's comments that I copied off the web. As you
can see it goes into the application files to employ the controls. =============== #1 02-26-2005, 11:06 AM RB Smissaert Guest Posts: n/a Minimize and maximize buttons userforms -------------------------------------------------------------------------- Please Register to Remove these Ads How do I add minimize and maximize buttons to a VBA userform? I have this code that does it, but when I change the caption of the userform the buttons don't work anymore. I am slowly coming to the conclusion that it probably is not worth the trouble and that it is better to make your own buttons. Public Declare Function FindWindow _ Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As Long, _ ByVal lpWindowName 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() Dim hWnd as Long hWnd = FindWindow(vbNullString, UserForm1.Caption) SetWindowLong hWnd, -16, &H20000 Or &H10000 Or &H84C80080 End Sub "Brian" wrote in message ... Tried it too. 1/3 of the User Form is cut off. How can I get the Min/Max Buttons on the User Form? "JLGWhiz" wrote: Hi Brian, I tested this and it might suit your puirpose more that the previous code. Private Sub UserForm_Initialize() Me.Height = Application.UsableHeight Me.Width = Application.UsableWidth End Sub "Brian" wrote in message ... I have a Multi Page User Form that I need to be able to resize according to Monitor Size and Resolution? I saw on Chip Pearsons site some code for resizing a User form, but I am not sure how to use it. I don't want to possibly mess up my computer settings. It would be nice if my User Form would have a Min, Max & Close button like most Windows apps have. Is it possible to get the User Form to Automaticaly resize according to Monitor size and resolution? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating multi-user Excel form for online | Excel Discussion (Misc queries) | |||
Hiding some pages on multi page form | Excel Programming | |||
User form grid - resize / font size | Excel Programming | |||
Why does Listview control shift to top on multi-page form? | Excel Programming | |||
how do i set up multi page user form | Excel Discussion (Misc queries) |