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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| Public Class Form2
Structure client
Dim numvoyage As Int32
Dim nom_pre_chau As String
Dim datedepart As String
Dim durée As String
Dim villedes As String
Dim imm As String
End Structure
Dim moi As Integer
Public c As client
Public tab(100) As client
Public indice As Integer = 0
Private _Index As Integer
Private Sub AfficheElementIndex()
TextBox2.Text = listvoyage(_Index).nom_pre_chau
TextBox3.Text = listvoyage(_Index).datedepart
TextBox4.Text = listvoyage(_Index).durée
TextBox5.Text = listvoyage(_Index).villedes
TextBox6.Text = listvoyage(_Index).imm
' autres textbox
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
moi = 0
moi += 1
TextBox1.Text = moi
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
c.numvoyage = TextBox1.Text
c.nom_pre_chau = TextBox2.Text
c.datedepart = TextBox3.Text
c.durée = TextBox4.Text
c.villedes = TextBox5.Text
c.imm = TextBox6.Text
TAB(indice) = c
indice = indice + 1
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
moi = moi + 1
TextBox1.Text = moi + 1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If _Index = listvoyage.Count - 1 Then
Exit Sub
End If
_Index += 1
AfficheElementIndex()
End Sub
End Class |
Partager