Код: Выделить всё
'=========================================================================================
' Ресайзинг элементв управления(LangMF9)
'=========================================================================================
<#Module=ResizeSample>
'---------------------------------------------------------------------------------
Sub Load(cmdstr)
'-------------------------------------------------------------------------
With Form
.AutoRedraw = True
.Caption = "RESIZING"
.Width = 540 * vbPx
.Height = 320 * vbPy
.Style.ControlBox = True
.Style.MaxButton = True
.Style.SizeBorder = True
'------------------------------------------------------------------
.Add "LCombo",1,"Width=135","Height=20", _
"Top=25","Left=5","Enabled=False"
.Add "Command",1,"Width=105","Height=20", _
"Top=25","Left=150","Caption=""Command"""
.Add "LCombo",2,"Width=135","Height=20", _
"Top=25","Left=275","Enabled=False"
.Add "Command",2,"Width=105","Height=20", _
"Top=25","Left=420","Caption=""Command"""
.Add "LCombo",3,"Width=95","Height=20", _
"Top=70","Left=230"
.Add "Text",1,"Width=95","Height=20", _
"Top=100","Left=230","Text="""""
.Add "Text",2,"Width=95","Height=20", _
"Top=130","Left=230","Text=""500"""
.Add "Check",1,"Width=260","Height=20", _
"Top=160","Left=55","Alignment=1","Caption=""Check"""
.Add "Command",3,"Width=150","Height=40", _
"Top=70","Left=370","Default=True","Caption=""Command"""
.Add "Command",4,"Width=150","Height=40", _
"Top=120","Left=370","Cancel=True","Caption=""Command"""
.Add "HScroll",1,"Width=365","Height=20", _
"Top=190","Left=5","FontSize=14"
.Add "ProgressBar",1,"Width=515","Height=20", _
"Top=220","Left=5"
.Add "COption",1,"Width=60","Height=20", _
"Top=260","Left=105","Caption=""COption"""
.Add "COption",2,"Width=60","Height=20", _
"Top=260","Left=170","Caption=""COption""","Value=True"
.Add "COption",3,"Width=60","Height=20", _
"Top=260","Left=235","Caption=""COption"""
'------------------------------------------------------------------
.Add "Text",3,"Width=80","Height=20", _
"Top=260","Left=310","MaxLength=2","Text=""Text""","Enabled=False"
.Add "Check",2,"Width=150","Height=20", _
"Top=260","Left=400","Caption=""Check"""
' Настроить ресайзинг элементов управления
' Применить метод Move2 к каждому, уже сформированному элементу
' управления с помощью runtime метода DoParams. В параметрах метода
' Move2 указать относительный размер и положение каждого элемента,
' как он изначально установлен на форме. При изменении размеров формы
' размер и положение каждого элемента будут изменятся пропорционально
' форме, сохраняя изначально заданное относительное положение.
'------------------------------------------------------------------
On Error Resume Next
For Each oCntrl In .Controls
sParam = CStr("Move2 " & oCntrl.Left*vbPx/.Width & "," & _
oCntrl.Top*vbPy/.Height & ",,," & _
oCntrl.Width*vbPx/.Width & "," & _
oCntrl.Height*vbPy/.Height & ",1")
.DoParams oCntrl, Array(sParam)
Next
On Error GoTo 0
End With
Form.Visible=True
DoEvents
Form.SetFocus()
DoEvents
End Sub
<#Module>
<#Form=Form>
Sub Form_Unload()
EndMF
DoEvents
End Sub
<#Form>