J
Jason Zischke
Hi All,
I loaded my program onto another computer this morning and it had problems
gettingthe screen resolution to size my forms. What is the problem here and
how can I fix this show it doesn't happen, below is my code.
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CXVIRTUALSCREEN As Long = 78
Private Const SM_CMONITORS As Long = 80
Private Declare Function GetSystemMetrics32 Lib "user32" Alias _
"GetSystemMetrics" (ByVal nIndex As Long) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long
Dim lWidth As Long, lHeight As Long
Sub getScreenResolution(lWidth As Long, lHeight As Long)
lWidth = GetSystemMetrics(SM_CXSCREEN)
lHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub
Private Sub UserForm_Activate()
getScreenResolution lWidth, lHeight
frmSTARTUP.Height = lHeight * 0.75
frmSTARTUP.Width = lWidth * 0.75
frmSTARTUP.Image7.Top = (lHeight * 0.75) - (48 * 1.5)
frmSTARTUP.Image5.Top = (lHeight * 0.75) - (42 * 1.5)
frmSTARTUP.Image5.Left = (lWidth * 0.75) - (90 * 1.5)
frmSTARTUP.Image3.Left = (lWidth * 0.17)
frmSTARTUP.Image3.Height = (lHeight * 0.445)
frmSTARTUP.Image3.Width = (lWidth * 0.565)
frmSTARTUP.Frame5.Left = (lWidth * 0.01)
frmSTARTUP.Frame5.Height = (lHeight * 0.44)
frmSTARTUP.Frame5.Width = (lWidth * 0.15)
frmSTARTUP.Label30.Top = (lHeight * 0.725) - (48 * 1.5)
frmSTARTUP.Show
End Sub
Thanks in Advance
Jason
I loaded my program onto another computer this morning and it had problems
gettingthe screen resolution to size my forms. What is the problem here and
how can I fix this show it doesn't happen, below is my code.
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Const SM_CYCAPTION = 4
Private Const SM_CXBORDER = 5
Private Const SM_CYBORDER = 6
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const SM_CXVIRTUALSCREEN As Long = 78
Private Const SM_CMONITORS As Long = 80
Private Declare Function GetSystemMetrics32 Lib "user32" Alias _
"GetSystemMetrics" (ByVal nIndex As Long) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long
Dim lWidth As Long, lHeight As Long
Sub getScreenResolution(lWidth As Long, lHeight As Long)
lWidth = GetSystemMetrics(SM_CXSCREEN)
lHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub
Private Sub UserForm_Activate()
getScreenResolution lWidth, lHeight
frmSTARTUP.Height = lHeight * 0.75
frmSTARTUP.Width = lWidth * 0.75
frmSTARTUP.Image7.Top = (lHeight * 0.75) - (48 * 1.5)
frmSTARTUP.Image5.Top = (lHeight * 0.75) - (42 * 1.5)
frmSTARTUP.Image5.Left = (lWidth * 0.75) - (90 * 1.5)
frmSTARTUP.Image3.Left = (lWidth * 0.17)
frmSTARTUP.Image3.Height = (lHeight * 0.445)
frmSTARTUP.Image3.Width = (lWidth * 0.565)
frmSTARTUP.Frame5.Left = (lWidth * 0.01)
frmSTARTUP.Frame5.Height = (lHeight * 0.44)
frmSTARTUP.Frame5.Width = (lWidth * 0.15)
frmSTARTUP.Label30.Top = (lHeight * 0.725) - (48 * 1.5)
frmSTARTUP.Show
End Sub
Thanks in Advance
Jason