AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

How to retrieve the screen resolution

It is often very useful to be able to resize your Visual Basic program depending on what the screen resolution is.  In this tip, we will explain how to find the resolution.

Code

ResWidth = Screen.Width \ Screen.TwipsPerPixelX
ResHeight = Screen.Height \ Screen.TwipsPerPixelY
ScreenRes = ResWidth & "x" & ResHeight  

ResWidth will be set to the resolution of the width on the screen, and ResHeight will be set to the resolution of the height of the screen.  ScreenRes will be set to something similar to:

800x600

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/