Sub Taille()
Dim XVal As Long, YVal As Long
Dim Resolution As String
Dim ZoomZoom As Integer
YVal = GetSystemMetrics(SM_CYSCREEN)
XVal = GetSystemMetrics(SM_CXSCREEN)
Resolution = XVal & ' x ' & YVal
On Error GoTo Message
If Resolution = '1280 x 1024' Then ZoomZoom = 120
If Resolution = '1280 x 960' Then ZoomZoom = 110
' If Resolution = 'XXXX x XXX' Then ZoomZoom = ?? <= Si votre résolution est non prévue...
If Resolution = '1280 x 720' Then ZoomZoom = 90
If Resolution = '1152 x 864' Then ZoomZoom = 80
If Resolution = '1024 x 768' Then ZoomZoom = 75
If Resolution = '800 x 600' Then ZoomZoom = 50
If Resolution = '640 x 480' Then ZoomZoom = 30
With frm_profil
.Zoom = ZoomZoom
End With
frm_profil.Show
Exit Sub
Message:
MsgBox 'Votre écran a une résolution non prévue de ' & XVal & ' par ' & YVal & _
Chr(10) & 'Modifier la macro en fonction...Thierry', vbInformation, 'Macro 'Taille' à modifier !'
End Sub