Link to home
Start Free TrialLog in
Avatar of LarryMann
LarryMann

asked on

screen size problem

How do you adjust the forms so that they can be viewed on any screen size?

I developed a program on a computer with it's screen set at 1024 X 768 and tried to run it later at 800 X 600. Large portions of the form were off-screen and now I can't figure out how to change it.  It will need to be viewed on a computer with 800 X 600 screen size.

How can I do this without starting all over?
Avatar of twalgrave
twalgrave

There are several solutions, but ultimately you should learn that apps should always be developed with end-user systems in mind.

Option 1:
Place the entire form contents into a borderless frame, add a set of scrollbars, and make the scrollbars control the view-window.

Option 2:
Re-design the form to fit in 800x600 resolution, possibly moving things into a tab control's tabs

Option 3: (not recommended)
Resize all controls on the form in the ReSize event so that everything fits proportional to the original.  The main problems with this are that some controls refuse to be resized (like comboboxes) unless you change other things (like fonts) which can have side-effects (jagged-fonts), or their resizing may not be precise (listboxes don't like to resize unless you shrink them just right or set a property) or the resizing may force things to wrap (captions) or become less usable (like textboxes for phone numbers shortened so the number does not display.

Option 4:
Get a replacement set of controls that automatically resize based on various system settings.

--
I would recommend #2 first, then #1, but not the other two.
Avatar of LarryMann

ASKER

Basically, I had started it using 800 X 600 resolution and ended up moving to another computer with different resolution.  Then when I tried to go back to my computer, it no longer sized correctly.
 I've tried the code from twalgrave and it did not work, it still would not show the entire form when I resized the screen.
 I also tried moving the componants on the page so they would fit on the 800 X 600 screen, but I can not get to the whole form this way.  I made the form as large as I could to edit it, but there was still a large amount of space on the right of the screen that I couldn't get to, but could see when the program was run.
Hi
can do one more thing.
When u load the project u can change the system resolution to 1024*.. and while unloading u can come back to the same one which the user has kept.
If u need the code.pls reply, i will post it
Good Luck...
The main users of the system will be using 1024 X 768 resolution. I am supposed to do a presentation, but the computer in the presantation room only goes up to 800 X 600.
ASKER CERTIFIED SOLUTION
Avatar of rspahitz
rspahitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, yeah...note that the above will scroll the frame entirely out of the window.  To make it scroll so that the right or bottom frame edge never go less than the right or bottom window edge, add some extra code in the resize to reset the Max values, something like this (untested):

Private Sub Form_Resize()
'...other stuff

' TO DO: watch out for the windowsize exceeding the frame size
HScroll1.Max = Frame1.Width - Me.ScaleWidth
VScroll1.Max = Frame1.Height - Me.ScaleHeight
end sub
Thanks, not quite as simple as I was hoping for, but I won't make that mistake again.
>not quite as simple as I was hoping

That's why we're here :)

Thanks for the "A" grade.