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
| Private Sub Ajouter_Click(sender As Object, e As EventArgs) Handles Ajouter.Click
nbrclients += 1
ReDim Preserve tab(nbrclients)
With enr
.nom = TextBox1.Text()
.prenom = TextBox2.Text()
.age = CInt(TextBox3.Text)
End With
tab(nbrclients) = enr
raz()
End Sub
Private Sub afficher_Click(sender As Object, e As EventArgs) Handles afficher.Click
Dim x, y As String
Dim z As Integer
Dim a As client
For i = 0 To tab.Length
MsgBox(tab.Length)
' MsgBox(tab(i).nom)
a = tab(i)
ListBox1.Items.Add(a)
x = tab(i).nom
ListBox1.Items.Add(x)
y = tab(i).prenom
ListBox1.Items.Add(y)
z = tab(i).age
ListBox1.Items.Add(z)
If (i = tab.Length) Then
End
End If
Next
End Sub |