وجدت هذا الكود لتثبيت الفورم على حسب ما قام به المبرمج وقد وضعته في Module1 ولكن لا يعمل وهذا هو الكود
وهل هناك طريقة لتثبيت الفورم ان لم تنفع طريقة الوحدة النمطية
Public Xtwips As Integer, Ytwips As Integer
Public Xpixels As Integer, Ypixels As Integer
Type FRMSIZE
Height As Long
Width As Long
End Type
Public RePosForm As Boolean
Public DoResize As Boolean
Sub Resize_For_Resolution(ByVal SFX As Single, _
ByVal SFY As Single, MyForm As Form)
Dim I As Integer
Dim SFFont As Single
SFFont = (SFX + SFY) / 2 ' average scale
' Size the Controls for the new resolution
On Error Resume Next ' for read-only or nonexistent properties
With MyForm
For I = 0 To .Count - 1
If TypeOf .Controls(I) Is ComboBox Then ' cannot change Height
.Controls(I).left = .Controls(I).left * SFX
.Controls(I).top = .Controls(I).top * SFY
.Controls(I).Width = .Controls(I).Width * SFX
Else
.Controls(I).Move .Controls(I).left * SFX, _
.Controls(I).top * SFY, _
.Controls(I).Width * SFX, _
.Controls(I).Height * SFY
End If
.Controls(I).FontSize = .Controls(I).FontSize * SFFont
Next I
If RePosForm Then
' Now size the Form
.Move .left * SFX, .top * SFY, .Width * SFX, .Height * SFY
End If
End With
End Sub
.gif)

