Controls that Expand and Contract with Form

F

Frank Wagner

I develop software for schools. Some of them have old Window 98 computers
that are used at 800 X 600 resolution and some are newer and kept at 1024 X
768 resolution. Some of my forms have design controls that go from edge to
edge. It I set them at the 800 X 600 resolution they fall short at the
higher resolution, and if I set them at the 1024 X 768 resolution they
overlap the form at the smaller resolution.

Is there any way that the design controls can be set so that they will
expand or contract with the form when it goes from one type of computer to
the other.

Any help would be appreciated.
 
F

Frank Wagner

I use Access 2000 and don't see cangrow and canshrink in the form properties.
is there something I'm missing
 
K

Klatuu

Even if 2000 had Can Grow, Can Shrink, it wouldn't work. Those properties
respond to the content of the control, not the screen resolution.

Here is a link to an API call that will tell you what the current screen
resolution is.

http://www.mvps.org/access/api/api0012.htm

You could then use that the dynamically size your controls.
To change the width, you use the control's Width property. It is set using
twips, which is 1440 twips per inch. So , to set a control's width to 2
inches, it would be:

Me.MyTextBox.Width = 2880

So I would suggest you use the Load event of the form (the Open is too
soon), determine the resolution of the screen, and set the control size
accordingly.
 
F

Frank Wagner

Dave:

Thanks. I had a feeling that's where I was headed, but hoped there might be
an easier way. Thanks for the reference as to how to automatically get the
screen resolution and screen size.

Your comments are right on target.

Thanks Again
 
P

pddxxx

Frank,

There are third-party form scaling solutions available that might
help:

A shareware version of a form rescaling module I wrote called
ShrinkerStretcher is available at this web site: http://www.peterssoftware.com/ss.htm

There's a form resizer at http://www.jamiessoftware.tk/resizeform/rf_jump.html
..

Another one: http://sourceforge.net/projects/modscaleform

The Access Developer's Handbook has form resizing code included:
http://www.amazon.com/exec/obidos/ISBN=0782119417/107-8064361-7403703

Hope this helps,

Peter De Baets
Peter's Software - Microsoft Access Tools for Developers
http://www.peterssoftware.com
 

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