Resize



Public Sub Resize_Control(ctl As Object, _
Height As Integer, Width As Integer, _
Interval As Integer)
Dim i As Integer
DoEvents
If (ctl.Height = Height And ctl.Width = Width) Then Exit Sub
Do Until ctl.Height = Height And ctl.Width = Width
If (ctl.Height < Height) Then
ctl.Height = ctl.Height + Interval
If (ctl.Height > Height) Then ' incase the controls
ctl.Height = Height' height goes past
'the desired..

End If ' change it to
End If' the desired
If (ctl.Height > Height) Then
ctl.Height = ctl.Height - Interval
If (ctl.Height < Height) Then
ctl.Height = Height
End If
End If
If (ctl.Width < Width) Then
ctl.Width = ctl.Width + Interval
If (ctl.Width > Width) Then
ctl.Width = Width
End If
End If
If (ctl.Width > Width) Then
ctl.Width = ctl.Width - Interval
If (ctl.Width < Width) Then
ctl.Width = Width
End If
End If
Loop
End Sub

Public Sub Move_Control(ctl As Object, Top As Integer, _
Left As Integer, Interval As Integer)
Dim i As Integer
DoEvents
If (ctl.Left = Left And ctl.Top = Top) Then Exit Sub
Do Until ctl.Left = Left And ctl.Top = Top
If (ctl.Left < Left) Then
ctl.Left = ctl.Left + Interval
If (ctl.Left > Left) Then
ctl.Left = Left
End If
End If
If (ctl.Left > Left) Then
ctl.Left = ctl.Left - Interval
If (ctl.Left < Left) Then
ctl.Left = Left
End If
End If
If (ctl.Top < Top) Then
ctl.Top = ctl.Top + Interval
If (ctl.Top > Top) Then
ctl.Top = Top
End If
End If
If (ctl.Top > Top) Then
ctl.Top = ctl.Top - Interval
If (ctl.Top < Top) Then
ctl.Top = Top
End If
End If
Loop
End Sub


(resize.html)- by Paolo Puglisi - Modifica del 25/3/2019