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 68 69 70 71 72 73
| Public Sub Ouverture_De_Fiche()
LBL_Nom_Entreprise.Text = Nom_Client.Société.Nom
LBL_Nom_Entreprise.Location = New Point(Me.Width / 2 - LBL_Nom_Entreprise.Width / 2, 24)
FlowLayoutPanel.Add(New FlowLayoutPanel)
Label.Add(New Label)
Label(Label.Count - 1).Text = "Ajouter une intervention :"
Label(Label.Count - 1).Width = 125
Label(Label.Count - 1).Height = 22
Label(Label.Count - 1).TextAlign = ContentAlignment.BottomCenter
Bouton.Add(New Button)
Bouton(Bouton.Count - 1).Text = "+"
Bouton(Bouton.Count - 1).Size = New Size(25, 22)
AddHandler Bouton(Bouton.Count - 1).Click, AddressOf AjouterUneIntervensionToolStripMenuItem_Click
For i As Integer = 0 To Nom_Client.Feuille.Count - 1
With FlowLayoutPanel(FlowLayoutPanel.Count - 1)
.FlowDirection = FlowDirection.LeftToRight
.Dock = DockStyle.Fill
.AutoScroll = True
.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowOnly
End With
TabControl1.TabPages.Add(Nom_Client.Feuille(i).Nom)
TabControl1.TabPages(TabControl1.TabPages.Count - 1).Controls.Add(FlowLayoutPanel(FlowLayoutPanel.Count - 1))
If Nom_Client.Feuille(i).Interventions.Count > 0 Then
ComboBox.Add(New ComboBox)
RichTextBox.Add(New RichTextBox)
With ComboBox(ComboBox.Count - 1)
.Size = New Size(200, 22)
.DropDownStyle = ComboBoxStyle.DropDownList
End With
For j As Integer = 0 To Nom_Client.Feuille(i).Interventions.Count - 1
ComboBox(ComboBox.Count - 1).Items.Add("Facture N° " & Nom_Client.Feuille(i).Interventions(j).Num_Facture & ". Le " & Nom_Client.Feuille(i).Interventions(j).Date1)
Next
With RichTextBox(RichTextBox.Count - 1)
.BorderStyle = BorderStyle.None
.BackColor = Control.DefaultBackColor
.Size = New Size(300, 50)
.ReadOnly = True
.Visible = False
End With
AddHandler RichTextBox(RichTextBox.Count - 1).Click, AddressOf RichTextBox_Click
AddHandler ComboBox(ComboBox.Count - 1).SelectedIndexChanged, AddressOf ComboBox_Click
With FlowLayoutPanel(FlowLayoutPanel.Count - 1)
.Controls.Add(ComboBox(ComboBox.Count - 1))
.Controls.Add(RichTextBox(RichTextBox.Count - 1))
.SetFlowBreak(ComboBox(ComboBox.Count - 1), True)
.SetFlowBreak(RichTextBox(RichTextBox.Count - 1), True)
End With
End If
With FlowLayoutPanel(FlowLayoutPanel.Count - 1)
.Controls.Add(Label(Label.Count - 1))
.Controls.Add(Bouton(Bouton.Count - 1))
End With
Next
End Sub |
Partager