avec un code pour l'interface de
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 Public Function deuxieme(List1) As Integer Dim max1 As Integer, max2 As Integer, suivant As Integer, i As Integer max1 = 0 max2 = 0 For i = 0 To UBound(List1) suivant = List1(i) If suivant >= max1 Then max2 = max1 max1 = suivant ElseIf suivant >= max2 Then max2 = suivant End If Next i deuxieme = max2 End Function
me renvoi a une erreur de compilation, nombres d'argument incorrect ou affectation de propriété incorecte en me surligant
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 Private Sub Cmd_second_Click() Dim tabsec() As Integer Dim n As Integer Dim i As Integer n = List1.ListCount ReDim tabsec(n) For i = 0 To n - 1 tabsec(i) = List1.List(i) Next i lbl_second.Caption = deuxieme(List1, n) End Suben jaune et deuxieme en bleu
Code : Sélectionner tout - Visualiser dans une fenêtre à part Private Sub Cmd_second_Click()
Partager