Const Img0$ = "C:\sample1.bmp"
Const Img1$ = "C:\recycle.bmp"
Const Img2$ = "C:\sample0.bmp"
Dim TabImg()
Private Sub ImageCombo1_Click()
MsgBox ImageCombo1.SelectedItem
End Sub
Private Sub ImageCombo1_Dropdown()
If ImageCombo1.ComboItems.Count = 0 Then Init
End Sub
Private Sub Init()
TabImg = Array(Img0, Img1, Img2)
With ImageList1
'Définit la dimension des images
.ImageHeight = 32 'Hauteur
.ImageWidth = 32 'Largeur
'Charge les nouvelles images
On Error Resume Next
For I = 0 To UBound(TabImg)
.ListImages.Add , "Cle" & I, LoadPicture(TabImg(I))
If Err = 53 Then MsgBox "Je ne crois pas que " & Img0 & " existe chez vous ?": Exit Sub
Next I
End With
Set ImageCombo1.ImageList = ImageList1
For I = 0 To UBound(TabImg)
ImageCombo1.ComboItems.Add , "Cle" & I, "Prenom" & I, I + 1, I, 1
Next I
End Sub