Public Class Form1 Dim mots() As String = {"banane", "bateau", "bijou", "batman"} Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged ListBox1.Items.Clear() ListBox1.Items.AddRange(Array.FindAll(mots, AddressOf Recherche)) End Sub Private Function Recherche(ByVal mot As String) As Boolean Return mot.StartsWith(TextBox1.Text) End Function End Class
Dim requete As IEnumerable(Of String) = From mot As String In mots Where mot.StartsWith("ba") Order By mot.Length Ascending For Each mot As String In requete Debug.Print(mot) Next
Public Class Games Public Shared ReadOnly DescriptComparer As New DescriptComparerClass Public rom As String Public descript As String Public genre As String '........ Public Index as integer 'profite du constructeur pour renseigner l'index par exemple sub new(nIndex as integer) Index = nIndex '...........
Dim requete As IEnumerable(Of Games) = From game As Games In romIndex Where game.descript.StartsWith("Te") for each game as Games in requete messagebox.show(game.index) next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionromIndex.IndexOf(game)
romIndex.Sort