Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleGet the screen's current resolution
Keywordsscreen, resolution, size
CategoriesGraphics
 
The Screen object's Width and Height properties give the screen size in twips. Its TwipsPerPixelX and TwipsPerPixelY properties give the number of twips per pixel in the horizontal and vertical directions. Divide twips by twips-per-pixel to get pixels.
 
Private Sub Form_Load()
Dim wid As Integer
Dim hgt As Integer

    wid = Screen.Width \ Screen.TwipsPerPixelX
    hgt = Screen.Height \ Screen.TwipsPerPixelY

    Label1.Caption = Format$(wid) & " x " & Format$(hgt)
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated