Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Adjust for Screen Resolution?

Status
Not open for further replies.

Steven547

Technical User
Sep 15, 2004
165
US
Is there a way to have an access form auto adjust itself based on the users screen resolution? I have a form I created in 1280x768 (something like that), but the resolution for the users varies. Isn't there code to add for this to auto adjust?

Thanks.
 
How are ya Steven547 . . .

Have a look here ShrinkerStretcher 10.2

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Yea...I've been searching and I found that, but I'm at work and I don't think they'll allow me to use a 3rd party. I heard there was a module that had code for it. What I found so far was this following, but a lot of it doesn't seem like it's access code...?

* --- Determine Workstation Display Settings ---
mnScreenW = SYSMETRIC(1) && Screen Width
mnScreenH = SYSMETRIC(2) && Screen Height

IF _SCREEN.WIDTH < (THISFORM.WIDTH * 1.1);
OR _SCREEN.HEIGHT < (THISFORM.HEIGHT * 1.1)
* --- Save Values For Return To 'Normal' ---
ThisForm.ScreenHeight = _SCREEN.HEIGHT
ThisForm.ScreenWidth = _SCREEN.WIDTH

* --- Change Screen Size ---
_SCREEN.HEIGHT = (mnScreenH * .85)
_SCREEN.WIDTH = (mnScreenW * .97)
_SCREEN.AUTOCENTER = .F.
_Screen.Refresh

* --- Original Auto-Center No Longer Works ---
* -- Modify FORM Position To Center On New Screen Size ---
THISFORM.TOP = (((mnScreenH * .85) - THISFORM.HEIGHT) / 2)
THISFORM.LEFT = (((mnScreenW * .97) - THISFORM.WIDTH) / 2)
ENDIF
 
ThisForm.ScreenWidth = _SCREEN.WIDTH

I now "ThisForm.ScreenWidth" would be me.ScreenWidth right? But I don't think "Screen" is correct?

And what would _Screen.width be?
 
Steven547 . . .

The code you presented [blue]only accounts for sizing the form.[/blue] You also have to account for the sizes of sections, textboxes, fonts, other objects, as well porportional spacing between objects.

This is alot work considering you have to [blue]keep track of object positions[/blue] as well (that is if [blue]you don't want resizing to produce scroll bars!)[/blue]

So to be sure ... [purple]this is a much more formidable task then your code shows![/purple]. If you consider forms with large numbers of objects, a long and arduous amount of design time comes to the surface.

I've not used the 3rd party software I presented, but I have seen it tested on a coworkers machine. The results were very good.

[blue]Good Luck[/blue] in finding resolution here. If I come across anything worthy I'll be sure and let you know . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
There is a chapter in the Access Developers HandBook on creating resizable forms. It basically drills down through the form and it's controls, resizing everything by the same ratio. It takes into account such things as changing font sizes as well as the control size.

I tried it once and the results were functional but not very aesthetically pleasing. The problem is that while you want some controls to grow and shrink at the same ratio as the form resizes, other controls look ridiculous once they get past a certain size. Buttons for example start looking very Fischer-Pricey after a certain size is exceeded.

Only practical solution I have ever found is to design the form for the minimum resolution you expect the users to have.

 
Basically what I decided to do from researching on here, is just create the form in a low resolution. That way, when a higher resolution user opens it, it looks fine on their screen as well. It's a "band-aid" fix for now, but it works.

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top