ok mais je voudrai les lignes de code
For i = 0 to listbox1.count -1
...... du code ...
Next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questiondim Valeur as Long Valeur = 355 Dim Valint as Integer Valint = Cint(Valeur) ' là c'est ok Dim StrValeur as String StrValeur = "355" Valint= Val(StrValeur) ' là c'est Ok avec Val Valint = Cint(StrValeur) ' là c'est type incompatible
Dim lmax as Integer, valeur as Integer Dim i As Integer lmax = Val(List10.List(0)) ' valeur premier élément de la liste For i = 1 To List10.ListCount - 1 valeur = Val(List10.List(i)) ' valeur élément suivant If valeur > lmax Then ' si valeur > lmax cette valeur devient lmax lmax = valeur End If Next i ' affiche lmax dans la TextBox Text1.Text = Cstr(lmax)
' on prend la première valeur de la listbox comme max Dim lmax as Integer = List10.List(0)) ' on parcourt la Listbox à partir du second élément For i = 1 to List10.ListCount - 1 ' si supérieur à lmax on a un nouveau lmax If Cint(List10.List(i)) > Lmax Then lmax = Cint(List10.List(i)) End if Next i ' lmax dans la Textbox Textbox1.Text = Cstr(lmax)
Dim lmax As Intèger Dim b As Integer For b = 0 To List10.ListCount - 1 If CInt(List10.List(b)) > lmax Then lmax = CInt(List10.List(b)) End If Next Text1.Text = CStr(lmax)
' Déclare la variable. 'Dim X ' Obtient l'index en cours. ' X = List10.TopIndex ' Redéfinit le premier élément. 'List10.TopIndex = List10.TopIndex + 5 'If List10.TopIndex = X Then List10.TopIndex = 0 'Text1 = List10
Private Sub List10_Click() Dim lmax As Integer Dim b As Integer lmax = 0 For b = 1 To List10.ListCount - 1 If (List10.List(b)) > lmax Then ' ici supérieur à suffit lmax = (List10.List(b)) Text1.Text = lmax ' cette ligne est mal placée End If Next
Text1.Text = lmaxbien que fonctionnant est incorrecte ! Où est le
Cstr(lmax)qui transforme lmax qui est une valeur de type Integer en chaine de caractères ? de plus cette ligne est mal placée
Dim lmax as Integer = Cint(List10.List(0)) For i = 1 to List10.ListCount - 1 If Cint(List10.List(i)) > Lmax Then lmax = Cint(List10.List(i)) End if Next i Text1.Text = Cstr(lmax)
Dim lmax as Integer lmax = Cint(List10.List(0)) For i = 1 to List10.ListCount - 1 If Cint(List10.List(i)) > Lmax Then lmax = Cint(List10.List(i)) End if Next i Text1.Text = Cstr(lmax)
le lien je l'ai lu mais je m'en fiche(ça devrait être dans le message 22) j'ai pas eu envie d'aller le chercher ce PC.
21 févr. 2015 à 09:22
ex valeurs stocke dans une listbox nomme list2
valeur maxi a afficher dans un textbox nomme text1