Screen Resolution

  • Thread starter Thread starter karim69
  • Start date Start date
K

karim69

Guest
I would like to know how can i change the screen resolution whitout using an API.
thanks.
 
Screen resolution isn't an Access function. It is a Windows function. If you don't want to use a Windows API, you cannot hope to change the screen resolution.
 
karim69,

It is easy to do. I have an Access 97 sample db I could send you if you are interested.

You have to keep in mind that it is an unwritten rule not to mess with a users system settings.
 
In response to those of you who asked for the demo, I am posting it here...

I have tested this with Windows 98 and XP using Access 97.

HTH those in need!
 

Attachments

That screen resolution works on windows 2000 as well.

This brings another question Is it better to

a. Resize the forms to fit the current screen resolution which is being used. This is sonething I do at the moment but can result in a small delay for the user as it resizes particularly where a lot of controls are used on a form.

b. Change the resolution to match that in which the db was developed when you open the db, and change it back again when the db is closed. Initial thoughts are that it would be less hassle having to resize all of the forms no problems as they open but if the user minimizes they will be left with the resolution the system was developed in not the one they normally use - unless they are the same.

Any thoughts appreciated

John
 
Screen Resolution with Access 2000 & Windows 2000

Hi,

I have been playing with ghunson's sample 97 database that changes the user's screen resolution. It works great, but I can't get it to work with an Access 2000 database.

Note: I did't have to add the two lines of code specified in the module when using a Windows 2000 OS. As long as I didn't convert the database to Access 2000 it was fine.

Has anyone made any changes to the code so that it will work with an Access 2000 database?

Thanks,
BJS:confused:
 
I am trying to reduce the repetitive code in my previous sample. I am getting a compile error "Expected: = " error message.

I am using this as the name of the function for I want to call the function with the resolution variables within the name...

Public Function ChangeResolutionNEW(vWidth As Variant, vHeight As Variant)

Then I want to call the function like this...

ChangeResolutionNEW(1024, 768)

But it is not working. Can you spot what I am doing wrong? The attached file has the original form and module and the new form, module and function all have the word NEW at the end of the names.

Thanks in advance for your help!
 

Attachments

ghudson

That looks like a nice tidy up

When you call the code take the brackets out

i.e.

ChangeResolutionNEW 1024, 768

John:)
 
First, you created 2 functions with the same name (ChangeResolutionNEW)in the 2 modules. Delete one out or rename one of it.

Second, modify the code in the new form to.

Option Compare Database
Option Explicit

Dim I As Long

Private Sub bChangeResolution800x600_Click()
I = ChangeResolutionNEW(800, 600)
End Sub
...

And also check the link at http://www.utteraccess.com/forums/showflat.php?Cat=&Board=access_97&Number=113161&page=0&view=collapsed&sb=5&o=&fpart=1 and at http://www.utteraccess.com/forums/showflat.php?Cat=&Board=access_97&Number=113403&Forum=access_97&Words=resolution&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=1week&Main=113279&Search=true#Post113403
 
Last edited:
ghudson

Try this go to the change resolution screen and pick one. I'd be interested to know if it works for you as it works for me.
Thanks

John
 

Attachments

John.Woody, strange but it works for me know?!?!

Tim K., thanks for your suggestion for it works as well. Thanks also for the link to the Utter Access site. The more resources the better. I will have to wait until next week to play with the samples posted there but they sound interesting.

I have attached the latest version to the Access 97 ChangeScreenResolution.mdb sample. It reduces the repetitive code that my first version had. Enjoy!

If anybody has any suggestions, please post them. Thanks!
 

Attachments

John, your sample works fine on my Windows XP computer using Access 97. I liked your sample, nice imporvements since the last time you sent it to me.

I have attached a sample (I have no idea where I found the code) db that will give you the correct screen size HxW (including the task bar).

HTH
 

Attachments

ghudson

Thanks for that last db. Its much easier to use than the other one, and gives the proper info. I've worked the screen change in to a 1/2 completed db for someone to automatically change their resolution to 800x600 on open and back to their origional on exit, and put a switch in to turn the facility on or off. I feel this would give good benefits to users and may be less quirky than resizing forms as they open. It will be interesting to get some feedback when I eventually deploy it. ;)

John
 
Great topic and one that has been on my list of issue to resolve.

I was pondering the outcome of an programmed resolution change for a deployed app.

If the user had a different resolution and it was changed without warning, I envision every sort of reaction by the users.

Interesting images of these reactions conjur themselves up to me, especially with some potential users I know personally. Pretty amusing I might say.

Short of catching extreme hell from them afterward, I would best alert them ahead of time of the upcoming change. (But then...maybe it would be worth the verbal assault??) I wouldn't do that to a stranger though.

I can figure the enabling code from what was posted earlier, but what code would you reverse the process upon quitting the app?
 
My, what an old thread you have disturbed. ;)

You will have to store the users original resolution settings [in a table] and then reset them back in the OnClose event of your application.

ie...hidden form that closes when the db is closed

I still recommend that you design your application to work with the lowest resolution for all users. Windows 95 computers will require a restart for the resolution to be changed. Also, when you do change the resolution via code, the look of the other open applications could look strange and the normal application menu buttons (Min, Max and Restore) might not be visible.

HTH
 
Very interesting to say the least.....

I, being an amature DB creator, am at a loss when it comes to supplying input in this topic, but was wondering if there was a way to automate the reverse on exiting the program. Was wondering if anyone has actually used this code and if so what did you do to supply the end user a way to reset the system

Ricky
 
As GHudson says above Store the origional values (I only use the horizontal) in a table then you can reverse to the origional settings when you exit the db.

The main problems I encountered were:

1. If the user multitasks between apps with the db open they get the other app in the screen resolution of the app.

2. With some monitors (particularly tft) when the screen res changes the monitor's auto adjust has to reset the refresh giving a couple of seconds flicker and adjustment.

For these reasons I decided not to persue this path but went back to using resizing code which resizes the forms and controls to fit what ever screen resolution the user is running.
 
JW, thanks for the input. I'd be interested in seeing that code for resizing if you don't mind sending it.

Thanks
 
I haven't tried the solutions here but wanted to let you know about an alternative that I have used with no problems. Located in the download section of www.developershandbook.com is a resizer which doesn't reset the screen resolution but resizes the form instead. This way you have no problems with multi-tasking and there is very little delay in form adjustment.
 

Users who are viewing this thread

Back
Top Bottom