1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub Image3_Click()
' Routing pour insérer image dans un contrôle de formulaire ActiveX
Dim Pict
Dim ImgFileFormat As String
Dim Ans As Integer
ImgFileFormat = "Fichier image JPEG (*.jpg),*.jpg,Bitmap (*.bmp),*.bmp,Png (*.png),*.png"
Pict = Application.GetOpenFilename(ImgFileFormat, Title:="Sélectionne une image")
If Pict = False Then 'Aucune image sélectionnée
If MsgBox("Etes-vous certain de ne pas insèrer d'image", vbYesNo + vbQuestion + vbDefaultButton1 + vbApplicationModal, "Demande de confirmation d'image") = vbNo Then
Pict = ""
MsgBox "Aucune image selectionnnée"
Image3.Picture = LoadPicture(Pict)
Exit Sub
End If
Else
Image3.Picture = LoadPicture(Pict)
Image3.PictureSizeMode = fmPictureSizeModeZoom
End If
End Sub |