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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize Open Form according to Desktop settings 2

Status
Not open for further replies.

kjv1611

New member
Jul 9, 2003
10,758
US
I may be in well over my head with this idea, but thought I could check here to see if anyone knew if it were possible. The reason I have is that some people will have one 17 inch monitor, some will have one 15 inch monitor, and some will have 2 17 inch monitors. Also, some users will have their Settings at 800x600, while others at 1024x768. Does anyone have an idea how to accomplish this (either through code or through a setting on each form?

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
if you just do a docmd.maximize at the on_open event of the form, it will always fit to the current screen (the layout has to be designed for the lets say minimal size/resolution your users could have).


HTH,
fly

Martin Serra Jr.
 
First of all, the size of the monitor should make no difference. It is the resolution that counts. It is possible to dynamically resize forms and their controls based on the resolution. I don't know of one specifically, but I do know there are 3rd party ActiveX controls designed for this purpose, but I have no idea as to cost.

You can do it yourself, but it does require a fair amount of effort, so I would question whether it's worth doing.

With respect to the number of monitors, I'm curious as to what you'd want to do in that situation.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
In the On Load event, put in:

Code:
Docmd.Restore

Hopefully, that gets you where you want to go.
If not, please post with more info.



HTH,
Bob [morning]
 
to repeat myself:

sorry Bob, its not restore, its:
Code:
docmd.maximize

and to CajunCenturion:
yeah, I've also seen this kind of stuff, resizing your forms/control dragging an edge of the window, but it's not nice at all and requires a lot of code.

so again my advice:
design your application to best fit the screensize/resolution combination you expect your user to have (it's like designing a webpage, what do you expect your users to have as a display device and resolution ?)

HTH,
fly

Martin Serra Jr.
 
Thanks for all the different approaches and efforts, here. My reasoning here for making differences is this:
Currently, the forms all look fine on screens set to 1024x768, but if someone has their resolution set to 800x600, then some of the buttons do not want to show up.
Also, as far as the dual monitor verses single deal, I would not think it would be an issue at all, except from another small Database I created for a totally separate task. On occasion, it seems, that after I have moved an open form in that database over to the right hand side monitor, everything works fine until after I close and re-open the database. On occasion, the form will not show up when I press the associated button on the main switchboard. When I open the database for editing (Shift + Enter), and I open the form in design view, it is as if I had taken the form, and dragged the sides in to where the only thing that shows are the restore/max, close buttons and a little piece of the title bar. I know I could set the form to auto-center on open each time in the forms properties, but I don't want that, b/c of the dual monitors.

My idea for the form resizing would be similar to the way you resize a picture or print preview of a document (100%, 75%, etc). If there is not a logical way to do that, I may just scrap the whole idea for now, and maybe come back to it at a future date.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Docmd.maximize will make the form fill the monitor, regardless of size and resolution. It will also require the User to select the Restore button, if available, to allow resizing the window to his/her preference. The process will have to be repeated every time the form is opened.

Docmd.restore will open the form to the same dimensions as the window used for initiation. I believe the setting will be "remembered" by Windows and reused. This may be preferable to Stephen's Users.

If that is not enough control, the following link provides most information about pixels/resolutions/form sizes known to mankind.




HTH,
Bob [morning]
 

To some extent, this was recently discussed in either MS.A. or VB (I THINK ... somke detectors? ...) it was an Ms. A. forum. Still limited the effort to simply centering the (existing) set of controls in hte space available, so you need to do one (or more) adjustments to the overall design/installation. "Size" the form to the lowest resoloution any users has. OR. REQUIRS that the app only be run on systems where the resoloution is greater than or equal to the design. OR Write the additional code to actually resize the controls proportionally.




MichaelRed
mlred@verizon.net

 
So, Bob,
With the MDE file there, you just download it, and include it with your forms, and just make the appropriate calls from the forms? That may be a possibility..

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Stephen,

When I need a break from my employer's database wars, I look here to learn. And contribute, if I can. In my travels, I have looked at automated form resizing out of curiosity, and possess one of the source books, "Access 2002 Desktop Developers Handbook". I have not needed to implement this so any further post by me would be guessing. Guesses may not help and likely would cost you time.

If you're lucky, one of the experts (See Forum MVPs) has implemented this or will take an interest and guide you to resolution utopia.

Good Luck!
Bob

P.S. I'll be monitoring the thread because I might need to make it happen sometime.
 
Thanks.. I have the same book, actually - Access 2002 Desktop Developers Handbook - also have the 2 other books kind of associated with it by Sybex. The Enterprise Developer's handbook, and also the VBA handbook. They seem to be good books, but I've actually gotten further here just searching posts, and posting my own questions. As far as the resizing stuff, where was it in that book? Page or chapter reference, if you remember..

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
You're asking a Vietnam vet if he has a memory...

But, you're in luck! [thumbsup2]

Begin at page 568, Steps to Successful Scaling in your first-mentioned book.



HTH,
Bob [morning]
 
Thanks! You can let your memory rest now, lol. I'm sure it's all burned out from remembering that.

I'll be reading that as I have time, and see what I can gather from there to add to other info posted here and/or found elsewhere. [WINK]

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
I hope i'm not entering a my opinion too late here.

Resizing doesn't work out as well as you think it might. I have used FMS, it's a bit slow, and it's not perfect. Often controls are a bit off, the labels aren't placed correctly, and the font looks wierd. When you stop and think about it how many pieces of software do you know that resize controls?

I think you might want to look at resizing the screen rather then the form. Well, that's what i have done, and it seems to have worked out better.

Mark P.

Bleh
 
Could you explain more - resizing the screen, Mark?
I am assuming you are speaking of adjusting the screen resolution for that particular program? Is that easily done from within an Access Database? That may not be the route that I would want to take, if it means changing the screen resolution, b/c some of the users prefer the 800/600, and it would need to change to that resolution whenever they switched out of the application. It would need to be useful in a window'ed environment, and not one where you only use that program by itself.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Thanks guys, you solved my problem with docmd.restore comand, but now I have another problem.

I set the size with docmd.movesize comand and after that I use the docmd.resetore comand. How can I prevent the user from resizing the window? My forms are quite small so they should fit to all screens atleast used in here. I first tried to open the forms as dialogs but that caused problems while opening a report. So that wasn't the resolution. Like I said If I only could now prevent the users from resizing the window I would be happy.
 
How Do I do that in code? Atleast

me.borderstyle = 1
or
me.borderstyle = thin

doesn't seem to work?
 
the form has to be open in designview:

Code:
DoCmd.OpenForm "frm_YourForm", acDesign
Forms!frm_YourForm.BorderStyle = 1
DoCmd.Close acForm, "frm_YourForm", acSaveYes
DoCmd.OpenForm "frm_YourForm", acNormal

HTH,
fly

Martin Serra Jr.
 
I was a little too fast again ...

if you open the form like this:
Code:
DoCmd.OpenForm "frm_YourForm", acDesign, , , , acHidden
you don't see it flickering over the screen while changing the borderstyle ...

;o)
fly

Martin Serra Jr.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top