CodePudding user response:
Similar this kind of situation is what mean
CodePudding user response:
Option ExplicitPrivate FormOldWidth As Long
Private FormOldHeight As Long
Public Sub ResizeInit (FormName As Form)
Dim Obj As Control
FormOldWidth=FormName. ScaleWidth
FormOldHeight=FormName. ScaleHeight
On the Error Resume Next
For Each Obj FormName In
Obj. Tag=Obj. Left & amp; "" & amp; Obj. Top & amp; "" & amp; Obj. Width & amp; "" & amp; Obj. Height & amp; "
"Next Obj
On Error GoTo 0
End Sub
Public Sub ResizeForm (FormName As Form)
Dim pos (4) As a Double
Dim As Long, I, StartPos TempPos As Long As Long
Dim Obj As Control
Dim ScaleX As Double, ScaleY As Double
ScaleX=FormName. ScaleWidth/FormOldWidth
ScaleY=FormName. ScaleHeight/FormOldHeight
On the Error Resume Next
For Each Obj FormName In
StartPos=1
For I=0 To 4
TempPos=InStr (StartPos, Obj. Tag, "", vbTextCompare)
If TempPos & gt; 0 Then
Pos (I)=Mid (Obj) Tag, StartPos, TempPos - StartPos)
StartPos=TempPos + 1
The Else
Pos (I)=0
End the If
Obj. Move pos (0) * ScaleX, ScaleY pos (1) * and pos (2) * ScaleX, ScaleY pos (3) *
Next I
Next Obj
On Error GoTo 0
End Sub
CodePudding user response:
Should be done,CodePudding user response:
Control of the left, top, width, height.CodePudding user response:
In the event of an Form_resize write their own code, the size of the change control.Give you a tip:
Don't width, height, top, left, and so on properties change one by one,
On controls own move method indicate once the above four properties quickly.