Option Explicit
Private Sub ComboBox1_Change()
ComboBox1.DropDown
'''''''''POUR RENDRE "IMAGE1"? INVISIBLE''''''''''
Image1.Visible = True
''''''''''''''''''''''''''''''''''''''''''''''''''
If ComboBox1 = "" Then Image1.Picture = LoadPicture(""): Exit Sub
Image1.Picture = LoadPicture(ThisWorkbook.Path & "\Documents\Photos botanique\" & "\" & IIf(ComboBox1.ListIndex = -1, "inexistante", ComboBox1) & ".jpg")
Me.Repaint
End Sub
Private Sub Image1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub UserForm_Activate()
With Me.Image1
.Top = (Me.InsideHeight - Me.Image1.Height) / 2
.Left = (Me.InsideWidth - Me.Image1.Width) / 2
End With
End Sub
Private Sub UserForm_Initialize()
'With Me.Image1
' .Top = (Me.InsideHeight - Me.Image1.Height) / 2
' .Left = (Me.InsideWidth - Me.Image1.Width) / 2
'End With
'''''''''POUR RENDRE "IMAGE1"? INVISIBLE''''''''''
Image1.Visible = False
''''''''''''''''''''''''''''''''''''''''''''''''''
Dim fichier
fichier = Dir(ThisWorkbook.Path & "\Documents\Photos botanique\" & "\*.jpg")
While fichier <> ""
If fichier <> "inexistante.jpg" Then ComboBox1.AddItem Left(fichier, Len(fichier) - 4)
fichier = Dir
Wend
fichier = Dir(ThisWorkbook.Path & "\Documents\Présentations\" & "\*.ppsm")
While fichier <> ""
If fichier <> "inexistante.jpg" Then ComboBox1.AddItem Left(fichier, Len(fichier) - 4)
fichier = Dir
Wend
End Sub
Private Sub Image5_Click()
Unload Me
Unload Me
End Sub