We help IT Professionals succeed at work.

How to change screen resolution through at run-time?

indiagenious asked
Medium Priority
Last Modified: 2010-05-02

i'm developing a standard product in VB. When i installed it on my one of the clients machine then some of the data entry forms appeared out of the screen. then, i realized that i'll have to set screen resolution at run-time.

i've come to know that i would have to use API. but, i don't know which.

plz, let me know and provide me if have codes also.

thankx in advance...

Watch Question

Personally, as a user, I wouldn't want an app changing my screen resolution/size.

Maybe you need to redo your app so it doesn't run off on say a 640x480.  Not everyone can/will use larger sizes depending on the video card.

Indiagenious you have two options.

1) You can arrange to sense the current screen resolution and automatically resize your program screen to match it. This is usually the preferred option as it does not change the set up of the host computer.

2) You can change the resolution of the users screen setup.

As your question asks about option 2 you may find an answer here:


I'd echo Dill's comment here - Never go about changing your user's desktop resultion. Just design your screens so that they 'stretch', fitting 640x480, but allowing more information to be shown in lists/trees/grids (rather than looking bigger) if the screen is larger.

OK, found the dangerous thing:

View code:
Description: This is ideal for a game. Many games simply look better or work better in a different resolution. Mostly the look is because whatever resolution you were using on your computer at the time is what the graphics in the game will look best as. This code will simply enable you to set their computer resolution to whatever you want.

Don't know if this works + there's a disclaimer.  Bottom line: better to 'stretch' your app like what andyclap has mentioned.

If you must really change the resolution, remember to change back the resolution to it's original configuration or the user might not be happy.

That's it!

glass cookie ; )

The indiagenious account has been closed for failure to provide feedback even after several requests.

Other participants, please advise as to who should get points for this.

Community Support
Since there are four respondants and all are good suggestions, I'd say split em up.

And of course, we get an 'A'.


Actually, reading this question as a VB developer rather than an EE administrator I can only say that you're absolutely right. The correct answer is: don't do it.

So, as an administrator I can decide that as you mentioned this first, you get the points.

;)  Okie.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.