Get screen resolution with Visual Basic

August 14, 2008 by admin  
Filed under Visual Basic

This Visual Basic example will find out your current screen resolution and return the result

Private Declare Function GetSystemMetrics Lib “User32″ (ByVal index As Long) As Long

Dim X As Long, Y As Long

Private Sub Form_Load()
Dim strDimensions
X = GetSystemMetrics(0)
Y = GetSystemMetrics(1)
strDimensions = CStr(X) & ” X ” & CStr(Y)
MsgBox (strDimensions)
End Sub

Related posts:

  1. Display all drives with Visual basic This Visual basic example displays all drives on your system,...
  2. Screen capture Screen capture using Visual Basic Private Declare Sub keybd_event Lib...
  3. convert to binary Public Function CBin(ByVal Nr As Long, Optional Precision As Integer...
  4. List all fonts present using Visual basic This example using Visual basic will list all screen fonts...
  5. Retrieves the path your application is running from. Private Sub Form_Load() MsgBox App.Path End Sub Bookmark It Hide...

Related posts brought to you by Yet Another Related Posts Plugin.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!