bonsoir,
voici mon soucis et encore une fois j'ai pas mal essayé beaucoup, grace à mercatog notement...
je vous joins mon code et j'espère que vous arriverai à resoudre mon problème mais moi j'y arrive pas et je tourne en rond...
j'aimerai qu'à chaque click sur la touche suivant m'affiche sa par exemple "c:\image1.jpg" 2eme click "c:\image2.jpg" etc...
ça fonctionne si le place ceci
mais je dois clicker sur le label pour afficher cette valeur mais j'aimerai qu'il s'affiche tout seul...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 Private Sub Label22_Click() Label22.Caption = Tb(Indx) End Sub
merci pour votre aide.
Tim
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 Option Explicit Dim Tb() As String Dim Indx As Integer Private Sub Label22_Click() Label22.Caption = Tb(Indx) End Sub Private Sub Quittez_Click() Unload Me End Sub Private Sub Precedent_Click() '--- Selection à chaque click de l'images du fond de monuserform à partir de c:\ If UBound(Tb) >= 1 Then Indx = IIf(Indx = 1, UBound(Tb), Indx - 1) MENU.Picture = Tb(Indx) End If End Sub Private Sub Suivant_Click() '--- Selection à chaque click de l'images du fond de monuserform à partir de c:\ If UBound(Tb) >= 1 Then Indx = IIf(Indx = UBound(Tb), 1, Indx + 1) MENU.Picture = LoadPicture(Tb(Indx)) End If End Sub Private Sub UserForm_Initialize() Dim Chemin As String, FichImg As String Dim i As Integer '--- Affichage de la date Label15.Caption = (Date) '--- Selection de l'images du fond de mon userform Chemin = "C:\" FichImg = Dir(Chemin & "*.jpg") Do While FichImg <> "" i = i + 1 ReDim Preserve Tb(1 To i) Tb(i) = Chemin & FichImg FichImg = Dir() Loop If UBound(Tb) >= 1 Then MENU.Picture = LoadPicture(Tb(1)) Indx = 1 End If End Sub
Partager