Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
objgControls.DesignWidth = 11940 ' ScaleWidth (Twips) of frmHome
objgControls.DesignHeight = 8175 ' ScaleHeight (Twips) of frmHome
objgControls.NowWidth = Me.ScaleWidth
objgControls.NowHeight = Me.ScaleHeight
objgControls.FormResizer Me
'====
'.BAS or .CLS module objgControls
Public DesignWidth As Double ' Form width at design time
Public DesignHeight As Double ' Form height at desin time
Public NowWidth As Double
Public NowHeight As Double
Public Sub FormResizer(frmW As Form)
Dim ctlW As Control, _
vW As Double, _
vH As Double, _
strName As String, _
blnWindowState As Boolean
Dim strDescription As String
strName = frmW.Name
If objgControls.IsTag(frmW, "RESIZED=YES") Then Exit Sub
frmW.Tag = objgFmt.AddKeyword(frmW.Tag, "RESIZED=YES")
If DesignWidth = 0 Or DesignHeight = 0 Then Exit Sub
vW = NowWidth / DesignWidth
vH = NowHeight / DesignHeight
If vW > 0.95 And vW < 1.05 And _
vH > 0.95 And vH < 1.05 Then
Exit Sub
End If
With frmW
On Error Resume Next
If frmW.WindowState <> vbMaximized Then
.Width = .Width * vW
.Height = .Height * vH
.Left = (NowWidth - .Width) / 2
.Top = (NowHeight - .Height) / 2
End If
On Error GoTo 0
End With
For Each ctlW In frmW.Controls
With ctlW
On Error Resume Next
strName = UCase$(.Name)
'Debug.Assert (strName <> "GRDATE")
.Font.Size = (.Font.Size * vH) \ 1
strDescription = Err.Description
On Error GoTo 0
On Error Resume Next
.Move .Left * vW, .Top * vH, .Width * vW, .Height * vH
If Err Then
.Left = .Left * vW
.Top = .Top * vH
.Width = .Width * vW
.Height = .Height * vH
End If
strDescription = Err.Description
On Error GoTo 0
End With
Next
End Sub
' One-time setting of Design and NOW (Run-time) Scale Dimensions from a known maximized MDI form.
objgControls.DesignWidth = 11940 ' ScaleWidth (Twips) of frmHome
objgControls.DesignHeight = 8175 ' ScaleHeight (Twips) of frmHome
objgControls.NowWidth = Me.ScaleWidth
objgControls.NowHeight = Me.ScaleHeight
[/code
Perhaps if I renamed it NOWScaleWidth.
[URL unfurl="true"]WWW.VBCompare.Com[/URL]