Desktop Resolution VB6

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 21:17, 19 August 2007 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Code Sample:

 Option Explicit

 Private Sub Form_Load()

   doScreenRes
   txtX3.Text = Screen.Width
   txtY3.Text = Screen.Height
   txtX4.Text = Screen.Width / 15
   txtY4.Text = Screen.Height / 15

 End Sub

 Sub doScreenRes()
   Dim intXres As Integer, intYres As Integer
 
   intXres = Me.Width
   intYres = Me.Height

   txtX1.Text = intXres
   txtY1.Text = intYres

   txtX2.Text = intXres / 15
   txtY2.Text = intYres / 15
 
 End Sub


 Private Sub Form_Resize()
   doScreenRes
 End Sub

 Sub doScreenRes()
   Dim intXres As Integer, intYres As Integer

   intXres = Me.ScaleWidth
   intYres = Me.ScaleHeight

   txtX1.Text = intXres
   txtY1.Text = intYres
 
   txtX2.Text = intXres / 15
   txtY2.Text = intYres / 15

 End Sub