Auto resize forms

S

SuperSlueth

I have several users who have different screen resolutions.

Is there anyway in VBA to resize the forms automatically on opening
according to the screen resolution
 
A

Allen Browne

If you want to do this, you are probably ready to buy the MS Access
Developers Handbook, by Ken Getz et al, published by Sybex. From memory, it
is chapter 8 that contains this code.

Before you do this, though, you might like to reconsider whether it is a
good idea. I for one absolutely hate software that assumes if I have big
screen that it ought to use all that space. The reason I bought a large
screen is so I could see lots of things at once, not so some idiot
programmer could consume the whole thing with his application.
 
S

SuperSlueth

It's was requested by our users, it's not so much the high resolution.
More the lower resolution users would like it to shrink to fit their
screens.
 
A

Allen Browne

Yes, that sounds about right.

The forms still have be to designed to be usable at the lowest resolution
the users could have, i.e. you cannot pack a screen full of 8-pt text boxes
at 1280x1204 and still expect it to be readable when "shrunk" to 640x480. As
a result, you need to ask what is the smallest resolution they want to be
use, and design for that. In practice, this means that you are actually
enlarging if you use this technique, as proportionally shrinking does not
work very well.

If you want the API call to read teh current screen settings:
http://vbnet.mvps.org/index.html?code/screen/displaysettings.htm

You can then proportionally resize upwards, paying special attention to
controls that contain other controls (such as option groups that contain
buttons that have attached labels) an so on.
 
T

Tom Ellison

Dear Allen:

So true. My applications will run at 800x600 and below, but the fonts
become much less distinct at that level and below. I generally make
1024x768 the lowest res for which I design, and require that setting at my
installations. I find I can shrink to this res and have good quality. I
simultaneously strongly recommend monitors of at least 19".

Nice as they are, the flat panels don't have much higer res that this. When
I design, I'm at 1600x1200 all the time. Doing this, and using a big
monitor is much more productive for me, but I'm always putting a lot of
things on the screen while I work.

It's hard to do, but I find I must convey the idea that to use old equipment
that is not up to today's standards is a waste of productivity. There are
often considerable productivity gains to be had at higher res, and I fully
intend to exploit them in the software I create. Having an adequate monitor
is a price you pay to get that productivity. There's no way around it.

Given an adequate monitor size, my applications always have print as large
or larger than your newspaper. People who think nothing of reading their
newspaper complain this is too small. I carry a newspaper along and show
them its bigger than the newspaper's font. The problem is, they want to put
their flat panel 3' away, so they can gain desk space. This is absurd. If
the computer is your main productivity tool, where you work for hours a day,
then put the face of the monitor no farther away than you would put a CRT
monitor. The desk space you save is behind the monitor, which isn't worth
the extra price of the flat panel. If you want the desk space in front of
the monitor, then you're going to need a 23" screen to get the same effect.
The price of that cools their ardor. The cause of the problem is built into
the laws of physics. "You can't fool mother nature."

Tom Ellison
 
A

Allen Browne

Thanks for sharing, Tom.

So SuperSlueth has a comparision, I also nominate 1024x768 as the minimum
target resolution when we write the specification for the app unless they
require otherwise, and I don't downsize it for them.

I recently saw one of my apps running at 800x600 with Windows set to very
large fonts. It looked weird, with less than a dozen rows filling the entire
screen. The user was sitting about 4 inches away from the screen, so I guess
she had some kind of visual impairment, and it was a good reminder that I
need to consider those users when I design.

For development, I use 2 x 19" monitors @ 1280 x 960. The main Access window
is on the left monitor, with the form (or whatever) open in design view. The
right monitor shows the VBA code, and is flipped on its edge (portrait
mode), so I can see an entire A4 page of code at once plus the form and its
controls and field list on the other monitor at the same time.
 
T

Tom Ellison

Dear Allen:

Now, I tried that once. I put a monitor on its side. The picture went
blank, and there was a high tension electrical crackle. Haven't tried it
again since. I thought I was lucky it wasn't destroyed. So, do you buy a
monitor that says you can put it on its side? And how do you change the
image 90 degrees? Finally, how do you set up the application? Do you open
it twice, once on each monitor?

Tom Ellison
 
A

Allen Browne

Okay, I've been using this setup for a few years now, so we are talking
about old 19" CRT monitors. Not a special monitor: just chose an ADI that
had the entire sides perforated with air vents, so the heat could still rise
out of it when on its side. Removed the base so it sits as close a practical
to the other one. Looks like this:
http://allenbrowne.com/temp/0417_Monitors.jpg

Graphics card is one of those nVidia ones that has 2 monitor outputs on the
back. The nVidia drivers support rotations of 90, 180, and 270, so there's
no difficulty getting the pic. rotated.

The graphics driver also supports different ways of knowing which window to
open an app on. I have it configured for "same window as last time", and it
treats the VBA IDE as a separate app, so Access opens on the landscape
monitor, and pressing Ctrl+G opens the VBA window on the portrait monitor.

If I were setting up now, I would certainly choose more up-to-date hardware,
but the idea is the same. From the perspective of productivity, this is the
best money I've spent on hardware in years. My son runs a 32" monitor, but -
for development work - I would not swap him, because I want the one monitor
showing what the user will see, and the other monitor giving me my code,
documentation, etc.
 
T

Tom Ellison

Dear Allen:

Wow, what a cool lookin' dude. Hair about the same shade of silver as mine!

Thanks for the run down. I still have 4 of those monitors that arc when set
on the side. I'm going to have to ask the store clerk to demonstrate how to
do this, and then get the two-port video. Sounds like fun, if I can keep
the boys from playing games all day long on it.

Tom Ellison
 
A

Allen Browne

Not sure the store dudes will know much about laying monitors on their
sides. They didn't when I originally asked. Of course, LCD would solve all
the issues of heat dissipation.

It's not really good for games either. In order to rotate the image, the
driver buffers the video output, so the frame rate is too slow for games.
Even pinball is visibly slower on a rotated monitor. The boy(s?) might be
happy enough with a decent video card that will run games well on the main
monitor. :)
 
T

Tom Ellison

Dear Allen:

They'd just set it back to the normal position and split the image. I've
seen picturs of that done on the internet. Pretty cool.

Tom Ellison
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top