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
| Public Class Form1
Private ListNiveaux As New List(Of Niveau)
Private Sub btnAddList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddList.Click
Dim niv As New Niveau(tbNomNiveau.Text, cbCat.Text, cbCompet.Text) 'alimenté par 1 TextBox et 2 ComboBox pour l'exemple.
ListNiveaux.Add(niv)
End Sub
Private Sub btnCherchNiveau_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCherchNiveau.Click
For Each ni As Niveau In ListNiveaux
If ni.NomNiveau = tbNomNiveau.Text Then
Console.WriteLine("Catégorie : " & ni.Categorie & " ,compétence : " & ni.Competence)
End If
Next
End Sub
End Class
Public Class Niveau
Public NomNiveau As String
Public Categorie As String
Public Competence As String
Public Sub New(ByVal m_Niveau As String, ByVal m_Categorie As String, ByVal m_Competence As String)
NomNiveau = m_Niveau
Categorie = m_Categorie
Competence = m_Competence
End Sub
End Class |