1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub btEingabe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btEingabe.Click
Dim lstArt As New List (Of Article)
Dim A as Article
dim n as treeNode
'ici, on remplit une liste avec des articles générés automatiquement
For i as Integer = 0 to 9
A = new Article
A.Numero = i.toString
A.Prix = (i +1) * 2.58 ' Arbitraire
A.Nom = "Article " & i.toString
lstArt.Add(A)
Next
'On boucle sur la liste pour afficher dans le treeView, l'ensemble des articles présents
For Each A in lstArt
n = tvList.nodes.add (A.Nom & " " & A.Prix.toString("C2"))
n.tag = A
Next
End Sub |
Partager