Probleme de tri en visual basic 2008 (.net)
Fermé
mrdevil
Messages postés
13
Date d'inscription
lundi 6 décembre 2010
Statut
Membre
Dernière intervention
3 juin 2012
-
16 févr. 2011 à 16:53
mrdevil Messages postés 13 Date d'inscription lundi 6 décembre 2010 Statut Membre Dernière intervention 3 juin 2012 - 16 févr. 2011 à 18:28
mrdevil Messages postés 13 Date d'inscription lundi 6 décembre 2010 Statut Membre Dernière intervention 3 juin 2012 - 16 févr. 2011 à 18:28
A voir également:
- Probleme de tri en visual basic 2008 (.net)
- Visual basic download - Télécharger - Langages
- Paint net - Télécharger - Dessin & Illustration
- Visual click avis ✓ - Forum Consommation et internet
- Net::err_unknown_url_scheme - Forum HTML
- Net framework - Télécharger - Divers Utilitaires
2 réponses
Bonjour,
Il te faudra trier à la main ...
Info
Il te faudra trier à la main ...
Private Sub btn_Tri_Direct_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btn_Tri_Direct.Click
Dim Valeur As String = String.Empty
Dim Indice As Int32 = 0
Dim I As Int32 = 0, J As Int32 = 0
InitialiseListeBox()
Indice = Me.ListBox1.Items.Count
For I = 0 To (Indice - 1)
For J = 0 To (Indice - 1)
If (Me.ListBox1.Items(J).ToString < Me.ListBox1.Items(I).ToString) Then
Valeur = Me.ListBox1.Items(J).ToString
Me.ListBox1.Items(J) = Me.ListBox1.Items(I).ToString
Me.ListBox1.Items(I) = Valeur
End If
Next
Next
End Sub
Info
mrdevil
Messages postés
13
Date d'inscription
lundi 6 décembre 2010
Statut
Membre
Dernière intervention
3 juin 2012
1
16 févr. 2011 à 18:28
16 févr. 2011 à 18:28
merci ,
j'ai reusi a le fair avec une autre methode
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
ListBox1.Sorted = False
Dim i As Integer
Dim t(ListBox1.Items.Count - 1) As String
Dim x As New ListBox
For i = 0 To ListBox1.Items.Count - 1
t(i) = ListBox1.Items(i)
Next
Array.Sort(t)
For i = ListBox1.Items.Count - 1 To 0 Step -1
x.Items.Add(t(i))
Next
ListBox1.Items.Clear()
ListBox1.Items.AddRange(x.Items)
End Sub
j'ai reusi a le fair avec une autre methode
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
ListBox1.Sorted = False
Dim i As Integer
Dim t(ListBox1.Items.Count - 1) As String
Dim x As New ListBox
For i = 0 To ListBox1.Items.Count - 1
t(i) = ListBox1.Items(i)
Next
Array.Sort(t)
For i = ListBox1.Items.Count - 1 To 0 Step -1
x.Items.Add(t(i))
Next
ListBox1.Items.Clear()
ListBox1.Items.AddRange(x.Items)
End Sub