Private Sub Form_Load()
Dim cnt As Control
zapros = Text1.Text '<<< Пиши код аккуратно, с отступами!
FH = Me.Height
FW = Me.Width
FSH = Me.ScaleHeight
FSW = Me.ScaleWidth
n% = Me.Controls.Count
ReDim cntList(1 To n%) As Control
ReDim Ts(1 To n%) As Double
ReDim Ls(1 To n%) As Double
ReDim Hs(1 To n%) As Double
ReDim Ws(1 To n%) As Double
nC = 0
On Error Resume Next '!!!
For Each cnt In Me.Controls
nC = nC + 1
Set cntList(nC) = cnt
Ts(nC) = cnt.Top
Ls(nC) = cnt.Left
Hs(nC) = cnt.Height
Ws(nC) = cnt.Width
Next
On Error GoTo 0 '!!!
End Sub
Private Sub Form_Resize()
SW# = Me.ScaleWidth
SH# = Me.ScaleHeight
Zw# = FSW / SW#
Zh# = FSH / SH#
On Error Resume Next '!!!
For i% = 1 To nC
cntList(i%).Width = Ws(i%) / Zw#
cntList(i%).Left = Ls(i%) / Zw#
cntList(i%).Height = Hs(i%) / Zh#
cntList(i%).Top = Ts(i%) / Zh#
Next i%
On Error GoTo 0 '!!!
End Sub
|