Ciao ho creato questa Sub per effettuare il resize degli oggetti nella mia MDI
ROUTINE
************************************************** ********************
Public Sub Resize_Control(ctl As Object, Height As Integer, Width As Integer, Interval As Integer)
Dim i As Integer
DoEvents
'ctl è il controllo da ripristinare
'height è la sua altezza
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
************************************************** ********************
Nel form_load la chiamo in questo modo per fare il resize di una Picture che fa da sfondo
Private Sub Form_Load()
Resize_Control picUp, 700, Me.ScaleWidth, 1
End Sub
La Form parte in fullscreen ma la picture non ha la larghezza della form, cosa gli posso passare come width per far si che la picture abbia la stessa larghezza del MDI?
Grazie a Lot:master: