Screen resolution

P

pompeyjim

I have managed to find code that will change the screen resolution when I
click a Command Button but I really need it to change it when I open the
database and then change it back to the original screen res when I close it.
Is this possible and if so how do I do it?

Thanks in advance.
 
D

Douglas J. Steele

I would suggest very strongly that this isn't something you should be doing.
As developers, we have no right to change settings that our users have
selected. Remember, your application is only one of many that they may be
using simultaneously, and whatever change you make is going to affect all of
their applications. I work with at least one visually impaired individual
who would be forced to scrap your application if you changed his resolution.

That having been said, you could have a form open as hidden when your
application opens. Put code in that form's Open and Close events. Since the
database cannot be closed without your hidden form closing, its Close code
will always run, regardless how the user shuts the application down (unless
they do so by powering off the machine, which will lead to a whole new set
of problems anyhow!)
 
P

pompeyjim

Douglas J. Steele said:
I would suggest very strongly that this isn't something you should be doing.
As developers, we have no right to change settings that our users have
selected. Remember, your application is only one of many that they may be
using simultaneously, and whatever change you make is going to affect all of
their applications. I work with at least one visually impaired individual
who would be forced to scrap your application if you changed his resolution.

That having been said, you could have a form open as hidden when your
application opens. Put code in that form's Open and Close events. Since the
database cannot be closed without your hidden form closing, its Close code
will always run, regardless how the user shuts the application down (unless
they do so by powering off the machine, which will lead to a whole new set
of problems anyhow!)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)






Thanks Doug.

The user in question is quite prepared to change the resolution of his
screens to accommodate the database but my thinking was that if he were to
install other software, that required another screen res or another user
changed it, then he would have to be changing the res every time he used each
bit of software. Therefore it would be nice if the database could change it
when opened and then change it back again to the original res when it closed.
Your idea will work, and I thank you for that, but the problem is you have to
stipulate the resolution, you want to change to, in code. Is there any way I
can put the original screen resolution into a variable when the DB opens so
that it knows what resolution to change it back to when it closes?
 
D

Douglas J. Steele

en it closed.
Your idea will work, and I thank you for that, but the problem is you have
to
stipulate the resolution, you want to change to, in code. Is there any way
I
can put the original screen resolution into a variable when the DB opens
so
that it knows what resolution to change it back to when it closes?

Since you've got that hidden form, you could create a textbox on the form,
store the original resolution there, then read it back when you're going to
reset it. (You could also store it in a form-level global variable, but
that's a little dicier, since global variables can be reset when an error
occurs)
 
P

pompeyjim

Douglas J. Steele said:
en it closed.

Since you've got that hidden form, you could create a textbox on the form,
store the original resolution there, then read it back when you're going to
reset it. (You could also store it in a form-level global variable, but
that's a little dicier, since global variables can be reset when an error
occurs)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Great, Thanks very much.
 

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