|
-
Jul 1st, 2005, 10:45 AM
#1
Thread Starter
Member
Resize UserForm
I have a userform that gathers quite a bit of info. The majority of the users will have their res set high enough to display the whole form so that I don't have to make it smaller and force them to scroll around to get to the various fields. However, some of them have really low res which makes the userform so big they can't even see the scroll bars. Is there a way to tell a userform to resize based on res? Or some other method that would serve to keep the form whole for the majority but visible for the rest?
-
Jul 1st, 2005, 12:06 PM
#2
Re: Resize UserForm
You could check the resolution and if its low then you could resize it down but then you would have to resize all controls
so they will be viewable.
Which Office App is this in, Excel?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 5th, 2005, 12:04 PM
#3
Thread Starter
Member
Re: Resize UserForm
This is in Word.
I'm guessing then that I would also need to reset the top & left position if I resize each control?
-
Jul 7th, 2005, 05:00 AM
#4
Thread Starter
Member
Re: Resize UserForm
I do still need help, but I'm not sure that I want to go the route of resizing the form. Right now it's just the minimum size for the users to be able to see their selections. If the res is decreased and it looks bigger, so will the text - so making the controls smaller seems like it would prevent them from seeing their input. What I really want to do is make the viewing area smaller (preferably on a res dependent basis) so that everything is still the same size, but only a portion of it is displayed with scroll bars to let the user see the rest. As it stands, in low res only a portion is shown, but it takes up the whole screen with the scroll bars pushed off the edges of the screen.
I am avoiding going the route of a tabbed form because these users react to such interfaces as though it presents more work and confusion.
-
Jul 13th, 2005, 10:50 AM
#5
Thread Starter
Member
Re: Resize UserForm
So what is the code for determining the resolution so that I can resize accordingly?
-
Jul 13th, 2005, 10:55 AM
#6
Re: Resize UserForm
VB Code:
Msgbox CStr(Screen.Width / Screen.TwipsPerPixelX) & "x" & CStr(Screen.Height / Screen.TwipsPerPixelY)
Found this in another post..aparently it will give the screen resolution
-
Jul 16th, 2005, 11:56 AM
#7
Lively Member
Re: Resize UserForm
Jumping in late:
Resizable userform
http://www.andypope.info/vba/resizeform.htm
or even size the userform to the window, but some controls may be hidden
VB Code:
With Me
.Top = Application.Top
.Left = Application.Left
.Height = Application.Height
.Width = Application.Width
End With
With Application
.WindowState = xlMinimized
.WindowState = xlMaximized
End With
This ensures that the form is sized according to Excels Application Window.
Best to design any forms in the lowest resolution possible, or propmt users to chage res if it doesn't match up with what you designed for
Example here
http://www.vbaexpress.com/kb/getarticle.php?kb_id=32
-
Jul 28th, 2005, 11:07 AM
#8
Thread Starter
Member
Re: Resize UserForm
These look great, thank you. I will try them out and respond at that time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|