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

How do I set the screen resolution

Status
Not open for further replies.

TMD

Programmer
Jan 19, 2002
24
GB
I want to alter the screen resolution when my program starts to ensure that all users will see the program the same i am choosing a safe resolution of 800x600, is there code that on form load can alter the resolution to this?

Thanx in advance.
 
I've tried to put in ton form load sub:
screen.height = 600
screen.width = 800

but when i run the program it says compile error: can't assign to a read-only object and highlights the first line of that command.
 
Setting the screen resolution takes some API calls. There are threads here that have it, do a search for them.

Just as a note, setting someone's screen size through code without their approving it is generally frowned upon. It's better to either:

1: Give them a messagebox that tells them that the screen resolution has to be a certain size before your program will run, and let them decide if they want to do it.

2: Use code to adapt your forms to whatever screen size the user has.

Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top