Desktop Resolution VB6: Difference between revisions

From Free Knowledge Base- The DUCK Project
Jump to navigation Jump to search
New page: '''Code Sample:''' Option Explicit Private Sub Form_Load() doScreenRes txtX3.Text = Screen.Width txtY3.Text = Screen.Height txtX4.Text = Screen.Width / 15 txtY...
 
 
(No difference)

Latest revision as of 20:17, 19 August 2007

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