1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Private Sub ResizeForResolution(ByVal RatioX As Single, ByVal RatioY As Single)
Dim RatioPolices As Single
RatioPolices = (RatioX + RatioY) / 2
Me.Width = ResolX("windowsize") * RatioX 'redéfinit la largeur du formulaire.
Dim j As Integer
For j = 0 To 9
If SectionExiste(j) = True Then 'voir la fonction plus bas
Me.Section(j).Height = Me.Section(j).Height * RatioY
End If
Next
Dim i As Integer
For i = 0 To Me.Controls.Count - 1
Debug.Print Me.Controls(i).Name
If TypeOf Me.Controls(i) Is ComboBox Then
Me.Controls(i).Move Me.Controls(i).Left * RatioX, Me.Controls(i).Top * RatioY, Me.Controls(i).Width * RatioX
Else
Me.Controls(i).Move Me.Controls(i).Left * RatioX, Me.Controls(i).Top * RatioY, Me.Controls(i).Width * RatioX, Me.Controls(i).Height * RatioY
End If
If TypeOf Me.Controls(i) Is Label Then Me.Controls(i).FontSize = Me.Controls(i).FontSize * RatioPolices
Next
End Sub |
Partager