Création de combobox automatiquement et liaison "conditionnelle"

Résolu
neolive31
Messages postés
20
Date d'inscription
lundi 12 juillet 2010
Statut
Membre
Dernière intervention
11 avril 2011
- 29 août 2010 à 16:41
cs_ShayW
Messages postés
3258
Date d'inscription
jeudi 26 novembre 2009
Statut
Membre
Dernière intervention
3 décembre 2019
- 5 sept. 2010 à 17:48
Bonjour

Je suis désolé tout d'abord si un forum sur ce sujet existe déjà.

Je suis en train de coder un petit programme, qui dans un certain module, en cliquant sur un bouton "ajout", m'ajoute des lignes à partir d'une ligne initiale. Jusque là aucun soucis. Par contre, je souhaite que, sur cette ligne, suivant ce qui est choisi dans la première combobox, les items (collection) dans une seconde soit différents.

Je m'explique avec le code suivant :

ceci me permet de créer une ligne supplémentaire lors d'un click sur le bouton, puis une autre, tant que l'on appuie.

Private Sub Button8_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
i = i + 1
j = 100 + i
k = 200 + i
l = 300 + i
m = 400 + i

Dim Richtextbox As System.Windows.Forms.RichTextBox
Dim Textbox(i) As System.Windows.Forms.TextBox
Dim Richtextbox1(k) As System.Windows.Forms.RichTextBox
Dim Combobox As System.Windows.Forms.ComboBox
Dim combobox1 As System.Windows.Forms.ComboBox
Dim combobox2(k) As System.Windows.Forms.ComboBox
Dim combobox3(l) As System.Windows.Forms.ComboBox
Dim combobox4(m) As System.Windows.Forms.ComboBox
Dim Familles() As String = {"", "toto", "tata", "titi"}
Dim Type_toto() As String {"Type 1 20 h", "Type 2 = 40 h", "Type 3 = 80 h", "Type 4 = 160 h", "Type 5 = 240 h"}
Dim Type_tata() As String {"Type 1 8 h", "Type 2 = 16 h", "Type 3 = 40 h", "Type 4 = 60 h", "Type 5 = 80 h"}
Dim Type_titi() As String {"Type 1 4 h", "Type 2 = 8 h", "Type 3 = 16 h", "Type 4 = 40 h", "Type 5 = 60 h"}

Richtextbox = New System.Windows.Forms.RichTextBox
Textbox(i) = New System.Windows.Forms.TextBox
Richtextbox1(k) = New System.Windows.Forms.RichTextBox
Combobox = New System.Windows.Forms.ComboBox
combobox1 = New System.Windows.Forms.ComboBox
combobox2(k) = New System.Windows.Forms.ComboBox
combobox3(l) = New System.Windows.Forms.ComboBox
combobox4(m) = New System.Windows.Forms.ComboBox

b = SplitContainer1.Height

If i = 1 Then

Richtextbox.Name = ("Richtextbox" & i)
Richtextbox.Visible = True
Richtextbox.Top = RichTextBox0.Top + 40
Richtextbox.Left = RichTextBox0.Left
Richtextbox.Height = RichTextBox0.Height
Richtextbox.Width = RichTextBox0.Width
Richtextbox.TabIndex = 0
Richtextbox.Multiline = True
Richtextbox.SelectionFont = New Font("Arial", 9, FontStyle.Bold)

Combobox.Name = "Combobox" & i
Combobox.Visible = True
Combobox.Top = ComboBox0.Top + 40
Combobox.Left = ComboBox0.Left
Combobox.Height = ComboBox0.Height
Combobox.Width = ComboBox0.Width
Combobox.TabIndex = 0
Combobox.DropDownStyle = ComboBoxStyle.DropDownList
Combobox.DataSource = Familles

combobox1.Name = "Combobox" & (j)
combobox1.Visible = True
combobox1.Top = ComboBox100.Top + 40
combobox1.Left = ComboBox100.Left
combobox1.Height = ComboBox100.Height
combobox1.Width = ComboBox100.Width
combobox1.TabIndex = 0
combobox1.DropDownStyle = ComboBoxStyle.DropDownList

combobox2(k).Visible = True
combobox2(k).Top = ComboBox200.Top + 40
combobox2(k).Left = ComboBox200.Left
combobox2(k).Name = "Combobox" & (k)
combobox2(k).Height = ComboBox200.Height
combobox2(k).Width = ComboBox200.Width
combobox2(k).TabIndex = 0
combobox2(k).DropDownStyle = ComboBoxStyle.DropDownList

combobox3(l).Visible = True
combobox3(l).Top = ComboBox300.Top + 40
combobox3(l).Left = ComboBox300.Left
combobox3(l).Name = "Combobox" & (l)
combobox3(l).Height = ComboBox300.Height
combobox3(l).Width = ComboBox300.Width
combobox3(l).TabIndex = 0
combobox3(l).DropDownStyle = ComboBoxStyle.DropDownList

combobox4(m).Visible = True
combobox4(m).Top = ComboBox400.Top + 40
combobox4(m).Left = ComboBox400.Left
combobox4(m).Name = "Combobox" & (m)
combobox4(m).Height = ComboBox400.Height
combobox4(m).Width = ComboBox400.Width
combobox4(m).TabIndex = 0
combobox4(m).DropDownStyle = ComboBoxStyle.DropDownList

Richtextbox1(k).Visible = True
Richtextbox1(k).Top = RichTextBox200.Top + 40
Richtextbox1(k).Left = RichTextBox200.Left
Richtextbox1(k).Name = "Richtextbox" & i
Richtextbox1(k).Height = RichTextBox200.Height
Richtextbox1(k).Width = RichTextBox200.Width
Richtextbox1(k).TabIndex = 0

Textbox(i).Visible = True
Textbox(i).Top = TextBox0.Top + 40
Textbox(i).Left = TextBox0.Left
Textbox(i).Name = "textbox" & i
Textbox(i).Height = TextBox0.Height
Textbox(i).Width = TextBox0.Width
Textbox(i).TabIndex = 0
Textbox(i).BackColor = Color.WhiteSmoke
Textbox(i).ReadOnly = True

'Richtextbox(i).Text = "Commentaires..."
'Richtextbox(i).ForeColor = Color.DarkGray

SplitContainer1.Panel1.Controls.Add(Richtextbox)

SplitContainer2.Panel1.Controls.Add(Combobox)
SplitContainer3.Panel1.Controls.Add(combobox1)
SplitContainer4.Panel1.Controls.Add(combobox2(k))
SplitContainer4.Panel2.Controls.Add(combobox3(l))
SplitContainer5.Panel1.Controls.Add(combobox4(m))
SplitContainer5.Panel2.Controls.Add(Richtextbox1(k))
SplitContainer5.Panel2.Controls.Add(Textbox(i))
a = Richtextbox.Top

Else
Richtextbox.Visible = True
Richtextbox.Top = a + 40
Richtextbox.Left = RichTextBox0.Left
Richtextbox.Name = "Richtextbox" & i
Richtextbox.Height = RichTextBox0.Height
Richtextbox.Width = RichTextBox0.Width
Richtextbox.TabIndex = 0
Richtextbox.SelectionFont = New Font("Arial", 9, FontStyle.Bold)

Combobox.Visible = True
Combobox.Top = a + 40
Combobox.Left = ComboBox0.Left
Combobox.Name = "combobox" & i
Combobox.Height = ComboBox0.Height
Combobox.Width = ComboBox0.Width
Combobox.TabIndex = 0
Combobox.DropDownStyle = ComboBoxStyle.DropDownList
Combobox.DataSource = Familles

combobox1.Visible = True
combobox1.Top = a + 40
combobox1.Left = ComboBox100.Left
combobox1.Name = "combobox" & (j)
combobox1.Height = ComboBox100.Height
combobox1.Width = ComboBox100.Width
combobox1.TabIndex = 0
combobox1.DropDownStyle = ComboBoxStyle.DropDownList

combobox2(k).Visible = True
combobox2(k).Top = a + 40
combobox2(k).Left = ComboBox200.Left
combobox2(k).Name = "combobox" & (k)
combobox2(k).Height = ComboBox200.Height
combobox2(k).Width = ComboBox200.Width
combobox2(k).TabIndex = 0
combobox2(k).DropDownStyle = ComboBoxStyle.DropDownList

combobox3(l).Visible = True
combobox3(l).Top = a + 40
combobox3(l).Left = ComboBox300.Left
combobox3(l).Name = "combobox" & (l)
combobox3(l).Height = ComboBox300.Height
combobox3(l).Width = ComboBox300.Width
combobox3(l).TabIndex = 0
combobox3(l).DropDownStyle = ComboBoxStyle.DropDownList

combobox4(m).Visible = True
combobox4(m).Top = a + 40
combobox4(m).Left = ComboBox400.Left
combobox4(m).Name = "combobox" & (m)
combobox4(m).Height = ComboBox400.Height
combobox4(m).Width = ComboBox400.Width
combobox4(m).TabIndex = 0
combobox4(m).DropDownStyle = ComboBoxStyle.DropDownList

Richtextbox1(k).Visible = True
Richtextbox1(k).Top = a + 40
Richtextbox1(k).Left = RichTextBox200.Left
Richtextbox1(k).Name = "Richtextbox" & i
Richtextbox1(k).Height = RichTextBox200.Height
Richtextbox1(k).Width = RichTextBox200.Width
Richtextbox1(k).TabIndex = 0

Textbox(i).Visible = True
Textbox(i).Top = a + 40
Textbox(i).Left = TextBox0.Left
Textbox(i).Name = "textbox" & i
Textbox(i).Height = TextBox0.Height
Textbox(i).Width = TextBox0.Width
Textbox(i).TabIndex = 0
Textbox(i).BackColor = Color.WhiteSmoke
Textbox(i).ReadOnly = True

SplitContainer1.Height = b + 40
SplitContainer5.Height = b + 40
SplitContainer2.Height = b + 40
SplitContainer3.Height = b + 40
SplitContainer1.Panel1.Controls.Add(Richtextbox)
SplitContainer2.Panel1.Controls.Add(Combobox)
SplitContainer3.Panel1.Controls.Add(combobox1)
SplitContainer4.Panel1.Controls.Add(combobox2(k))
SplitContainer4.Panel2.Controls.Add(combobox3(l))
SplitContainer5.Panel1.Controls.Add(combobox4(m))
SplitContainer5.Panel2.Controls.Add(Richtextbox1(k))
SplitContainer5.Panel2.Controls.Add(Textbox(i))
a = Richtextbox.Top
b = SplitContainer1.Height
End If

End Sub

jusque là ca marche.

par contre dès que je sélectionne par exemple toto dans la Combobox1 ((Combobox & i) avec i 1), combobox créer par un premier click sur "ajout", il faudrait que la combobox100 (= (Combobox & j) avec j = 100) soit le type_toto.

Or j'arrive à faire ceci pour la première ligne (ligne toujours présente) avec la commande :

Public Sub ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox0.SelectedIndexChanged
Dim Type_toto() As String {"Type 1 20 h", "Type 2 = 40 h", "Type 3 = 80 h", "Type 4 = 160 h", "Type 5 = 240 h"}
Dim Type_tata() As String {"Type 1 8 h", "Type 2 = 16 h", "Type 3 = 40 h", "Type 4 = 60 h", "Type 5 = 80 h"}
Dim Type_titi() As String {"Type 1 4 h", "Type 2 = 8 h", "Type 3 = 16 h", "Type 4 = 40 h", "Type 5 = 60 h"}
If ComboBox0.Text = "toto" Then
ComboBox100.Refresh()
ComboBox100.DataSource = Type_toto
ElseIf ComboBox0.Text = "tata" Then
ComboBox100.Refresh()
ComboBox100.DataSource = Type_tata
ElseIf ComboBox0.Text = "titi" Then
ComboBox100.Refresh()
ComboBox100.DataSource = Type_titi
End If
End Sub


Par contre pour toutes les autres combobox générées automatiquement, je n'arrive pas à écrire le même type d'action "général".

du genre

Public Sub ComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ("ComboBox" & i).SelectedIndexChanged
Dim Type_toto() As String {"Type 1 20 h", "Type 2 = 40 h", "Type 3 = 80 h", "Type 4 = 160 h", "Type 5 = 240 h"}
Dim Type_tata() As String {"Type 1 8 h", "Type 2 = 16 h", "Type 3 = 40 h", "Type 4 = 60 h", "Type 5 = 80 h"}
Dim Type_titi() As String {"Type 1 4 h", "Type 2 = 8 h", "Type 3 = 16 h", "Type 4 = 40 h", "Type 5 = 60 h"}
If ("ComboBox" & i).Text = "toto" Then
("ComboBox" & j).Refresh()
("ComboBox" & j).DataSource = Type_toto
ElseIf ("ComboBox" & i).Text = "tata" Then
("ComboBox" & j).Refresh()
("ComboBox" & j).DataSource = Type_tata
ElseIf ("ComboBox" & i).Text = "titi" Then
("ComboBox" & j).Refresh()
("ComboBox" & j).DataSource = Type_titi
End If
End Sub


Quelqu'un pourrait il m'aider ?

J'espère avoir été assez clair.

Merci énormément du temps que vous passerez à me répondre.

A+

Neolive

23 réponses

neolive31
Messages postés
20
Date d'inscription
lundi 12 juillet 2010
Statut
Membre
Dernière intervention
11 avril 2011

3 sept. 2010 à 16:55
Salut ShayW

Super pour ton code merci bien.

Du coup je l'ai adapté un peu à ce que souhaite faire.

Par contre, je me suis aperçu que les combobox se mettent à jour correctement tant que tu n'as pas créé un autre panel.

En fait seule les combobox du dernier panel créé se mettent à jour ?

Sais tu comment je pourrais faire pour éviter le problème ?

Merci encore pour ton code, il déchire carrément !!

Merci aussi pour temps que tu passes à m'aider.

et sinon, toi, tu bosses dans la prog ?

a+

Neolive

P.S : si tu veux je peux te transmettre en MP (car trop long sinon) le code de ma form pour que tu vois ce que je cherche à faire.
0
cs_ShayW
Messages postés
3258
Date d'inscription
jeudi 26 novembre 2009
Statut
Membre
Dernière intervention
3 décembre 2019
56
4 sept. 2010 à 21:58
Bonsoir

Oui ça serait mieux parce que programmer à peu
près ça ne va pas

dans le code chaque panel est indépendant ainsi
que chaque combobox

Par contre, je me suis aperçu que les combobox se mettent à jour correctement tant que tu n'as pas créé un autre panel.

Je ne comprend pas quand tu dis "se mette à jour" ?
il ne se mettent pas à jour j'écris les memes
données pour tous les combos de la meme famille
tu ne me pas dit d'où proviennent les données
pour les combos viennent t'elles d'une base de donnée tu ne vas pas ajouter titi tata toto
la creation des comboboxes dépend des panels
car seulement si la panel est crée alors j'y ajoute ses combos c.a.d chaque panel a ses propres vecteurs de combo

donc conclusion envoies moi en mp ton projet
les demandes du projets enfin tout ce qui est
nécessaire
0
cs_ShayW
Messages postés
3258
Date d'inscription
jeudi 26 novembre 2009
Statut
Membre
Dernière intervention
3 décembre 2019
56
5 sept. 2010 à 17:48
Je ne sais pas si tu as reçu le message privé
voila le code corrigé
après y avoir passer la matinée
il y a surrement encore des bugs
ajoutes les 2 boutons à la form
Public Class Form3
    Private Structure ligne
        Public listtype() As System.Windows.Forms.ComboBox
        Public listtype2() As System.Windows.Forms.RichTextBox
        Public listtype3() As System.Windows.Forms.RichTextBox
        Public combobox0() As System.Windows.Forms.ComboBox
        Public Richtextbox0() As System.Windows.Forms.RichTextBox
        Public combobox200() As System.Windows.Forms.ComboBox
        Public combobox300() As System.Windows.Forms.ComboBox
        Public RichTextBox400() As System.Windows.Forms.RichTextBox
        Public label100() As System.Windows.Forms.Label
        Public Richtextbox100() As System.Windows.Forms.RichTextBox
        'Public Richtextbox200() As System.Windows.Forms.RichTextBox
        Public countitem As Integer
    End Structure
    Private counterpanel As Integer
    Private label1 As System.Windows.Forms.Label
    Private Richtextbox200() As System.Windows.Forms.RichTextBox
    Private combobox500() As System.Windows.Forms.ComboBox
    Private countercombo() As ligne
    Private panels() As System.Windows.Forms.Panel
    Private panel1() As System.Windows.Forms.Panel
    Private panel2 As System.Windows.Forms.Panel
    Private panel3 As System.Windows.Forms.Panel
    Private panel4 As System.Windows.Forms.Panel
    Private label1000 As System.Windows.Forms.Label
    Private label1001() As System.Windows.Forms.Label
    Private label1002() As System.Windows.Forms.Label
    Private label1003() As System.Windows.Forms.Label
    Private label1004() As System.Windows.Forms.Label
    Private label1005() As System.Windows.Forms.Label
    Private label1006() As System.Windows.Forms.Label
    Private label1007() As System.Windows.Forms.Label
    Private label1008() As System.Windows.Forms.Label
    Private label1009() As System.Windows.Forms.Label
    Private label1010 As System.Windows.Forms.Label
    Private measure As System.Windows.Forms.Label
    
    Private ajout_ligne() As System.Windows.Forms.Button
    Private suppr_ligne() As System.Windows.Forms.Button

    Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        counterpanel = 0
        measure = New Label
        Me.supprim_phase.Enabled = False
        measure.Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
        ' measure.TextAlign = ContentAlignment.MiddleCenter 
        Me.WindowState = FormWindowState.Maximized
        Me.ajoutes_phase.Location = New Point(2, 1)
        Me.ajoutes_phase.AutoSize = True
        Me.supprim_phase.Location = New Point(Me.ajoutes_phase.Right + 4, 1)
        Me.supprim_phase.AutoSize = True
        Me.AutoScroll = True
        Me.BackColor = Color.LightGray
        label1 = New Label
        label1010 = New Label
        panel2 = New Panel
        panel3 = New Panel
        panel4 = New Panel
        ' Me.Text = "Devis ASG117 : " & " " & Choix.Nom_projet.Text.ToString & " // réf : " & Choix.référence.Text.ToString 
        Me.Controls.Add(label1)
        Me.Controls.Add(panel2)
        Me.Controls.Add(panel3)
        Me.Controls.Add(panel4)
        panel4.Controls.Add(label1010)
        panel3.Controls.Add(label1000)
        With panel2
            '.Anchor = AnchorStyles.None 
            .BorderStyle = BorderStyle.Fixed3D
            .Location = New Point(10, Me.ajoutes_phase.Bottom + 5)
            .Width = Me.Width * 0.95
            .Height = Me.Height * 0.95
            .BackColor = Color.Gainsboro
            .Visible = True
            .AutoScroll = True
        End With
        With panel3
            .BorderStyle = BorderStyle.FixedSingle
            .Location = New Point(1000, 2)
            .Width = 155
            .Height = 125
            .BackColor = Color.CadetBlue
            .Visible = True
        End With
        With panel4
            '.Anchor = AnchorStyles.None 
            .BorderStyle = BorderStyle.Fixed3D
            .Location = New Point(panel3.Right + 6, 2)
            .Width = 190
            .Height = 300
            .BackColor = Color.BlueViolet
            .Visible = True
            .AutoScroll = True
        End With
        With label1010
            .Location = New Point(4, 4)
            .Width = 182
            .Height = 300
            .Visible = True
        End With
        PreparecomboAndPanel()
    End Sub

    Private Sub PreparecomboAndPanel()
        'creer le vecteur panel 
        ReDim Preserve ajout_ligne(counterpanel)
        ReDim Preserve suppr_ligne(counterpanel)
        'creer les 2 combo de base et fixé la taille intitialle du vecteur 
        Dim ToolTip = New System.Windows.Forms.ToolTip
        ToolTip.SetToolTip(ajoutes_phase, "Ajout d'une phase")
        ToolTip.SetToolTip(supprim_phase, "Suppression d'une phase")
        ' ajoutes_phase.Location = New Point(2, Me.ajoutes_phase.Bottom + 3)
        ' ajoutes_phase.Height = 20
        ' ajoutes_phase.Width = 20
        ' ajoutes_phase.BackColor = Color.LightGray
        'panel3.Controls.Add(ajoutes_phase)
        ' supprim_phase.Location = New Point(30, ajoutes_phase.Top)
        ' supprim_phase.Height = 20
        ' supprim_phase.Width = 20
        ' supprim_phase.BackColor = Color.LightGray
        ' panel3.Controls.Add(supprim_phase)
        '       ajoutes_ligne.Location = New Point(1000, panel1(counterpanel).Height + 20) 
        'ajouter les combo à la panel 
        ReDim Preserve countercombo(counterpanel)
        countercombo(counterpanel).countitem = 0
    End Sub

    Private Sub ajoutes_phase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ajoutes_phase.Click

        'ajouter le combo à son vecteur le reserved word "preserve" indique qu'on aggrandit le vecteur 
        'sans  effacer l'ancien 
        ReDim Preserve ajout_ligne(counterpanel)
        ReDim Preserve suppr_ligne(counterpanel)
        ReDim Preserve panels(counterpanel)
        ReDim Preserve panel1(counterpanel)
        ReDim Preserve combobox500(counterpanel)
        ReDim Preserve Richtextbox200(counterpanel)
        ReDim Preserve label1001(counterpanel)
        ReDim Preserve label1002(counterpanel)
        ReDim Preserve label1003(counterpanel)
        ReDim Preserve label1004(counterpanel)
        ReDim Preserve label1005(counterpanel)
        ReDim Preserve label1006(counterpanel)
        ReDim Preserve label1007(counterpanel)
        ReDim Preserve label1008(counterpanel)
        ReDim Preserve label1009(counterpanel)
        ajout_ligne(counterpanel) = New Button
        suppr_ligne(counterpanel) = New Button
        panels(counterpanel) = New Panel
        panel1(counterpanel) = New Panel
        panel2.Controls.Add(panels(counterpanel))
        panels(counterpanel).Controls.Add(panel1(counterpanel))
        combobox500(counterpanel) = New ComboBox
        label1001(counterpanel) = New Label
        label1002(counterpanel) = New Label
        label1003(counterpanel) = New Label
        label1004(counterpanel) = New Label
        label1005(counterpanel) = New Label
        label1006(counterpanel) = New Label
        label1007(counterpanel) = New Label
        label1008(counterpanel) = New Label
        label1009(counterpanel) = New Label
        Richtextbox200(counterpanel) = New RichTextBox
        panels(counterpanel).Controls.Add(ajout_ligne(counterpanel))
        panels(counterpanel).Controls.Add(suppr_ligne(counterpanel))
        panels(counterpanel).Controls.Add(combobox500(counterpanel))
        panels(counterpanel).Controls.Add(label1001(counterpanel))
        panels(counterpanel).Controls.Add(label1002(counterpanel))
        panels(counterpanel).Controls.Add(label1003(counterpanel))
        panels(counterpanel).Controls.Add(label1004(counterpanel))
        panels(counterpanel).Controls.Add(label1005(counterpanel))
        panels(counterpanel).Controls.Add(label1006(counterpanel))
        panels(counterpanel).Controls.Add(label1007(counterpanel))
        panels(counterpanel).Controls.Add(label1008(counterpanel))
        panels(counterpanel).Controls.Add(label1009(counterpanel))
        With ajout_ligne(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            ajout_ligne(counterpanel).Text = "+"
            ajout_ligne(counterpanel).Location = New Point(1000, 45)
            ajout_ligne(counterpanel).Tag = counterpanel
            ajout_ligne(counterpanel).Visible = True
            ajout_ligne(counterpanel).Height = 20
            ajout_ligne(counterpanel).Width = 20
            AddHandler .Click, AddressOf ajout_ligne_click
        End With
        With suppr_ligne(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            suppr_ligne(counterpanel).Text = "-"
            suppr_ligne(counterpanel).Location = New Point(1025, 45)
            suppr_ligne(counterpanel).Tag = counterpanel
            suppr_ligne(counterpanel).Visible = True
            suppr_ligne(counterpanel).Height = 20
            suppr_ligne(counterpanel).Width = 20
            AddHandler .Click, AddressOf supprim_ligne_Click
        End With
        panels(counterpanel).Controls.Add(Richtextbox200(counterpanel))
        With combobox500(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Items.Add("")
            .Items.Add("2B3A")
            .Items.Add("PDR")
            .Items.Add("CDR")
            .Items.Add("Prooftest")
            .Items.Add("Corrélation")
            .Items.Add("Expertise")
            .Items.Add("Autre ...")
            measure.Text = "Corrélation"
            .Location = New Point(60, 10)
            .Width = measure.PreferredWidth * 1.2
            .Visible = True
            .DropDownStyle = ComboBoxStyle.DropDownList
            .Tag = counterpanel
            AddHandler .SelectedIndexChanged, AddressOf combobox500_SelectedIndexChanged
        End With
        With label1001(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(2, 12.5)
            measure.Text = "Phase :"
            .Width = measure.PreferredWidth
            .Text = "Phase :"
            .Visible = True
        End With
        With label1002(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(100, 50)
            measure.Text = "Tâches"
            .Width = measure.PreferredWidth
            .Text = "Tâches"
            .Visible = True
        End With
        With label1003(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1002(counterpanel).Right + 160, 50)
            measure.Text = "Familles"
            .Width = measure.PreferredWidth
            .Text = "Familles"
            .Visible = True
        End With
        With label1004(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1003(counterpanel).Right + 100, 50)
            measure.Text = "Type"
            .Width = measure.PreferredWidth
            .Text = "Type"
            .Visible = True
        End With
        With label1005(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1004(counterpanel).Right + 40, 50)
            measure.Text = "Difficulté"
            .Width = measure.PreferredWidth
            .Text = "Difficulté"
            .Visible = True
        End With
        With label1006(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1005(counterpanel).Right + 40, 50)
            measure.Text = "Maturité"
            .Width = measure.PreferredWidth
            .Text = "Maturité"
            .Visible = True
        End With
        With label1007(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1006(counterpanel).Right + 30, 50)
            measure.Text = "SF"
            .Width = measure.PreferredWidth
            .Text = "SF"
            .Visible = True
        End With
        With label1008(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1007(counterpanel).Right + 25, 50)
            measure.Text = "Total (h)"
            .Width = measure.PreferredWidth
            .Text = "Total (h)"
            .Visible = True
        End With
        With label1009(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(label1008(counterpanel).Right + 80, 50)
            measure.Text = "Commentaires"
            .Width = measure.PreferredWidth
            .Text = "Commentaires"
            .Visible = True
        End With
        With panels(counterpanel)
            .AutoScroll = True
            .AutoScrollMinSize = New Point(2222, 2233)
            .BorderStyle = BorderStyle.Fixed3D
            .Width = 1100
            .Height = panel1(counterpanel).Height + 200
            .BackColor = Color.LemonChiffon
            .Visible = True
            If counterpanel > 0 Then
                .Location = New Point(panels(counterpanel - 1).Left, panels(counterpanel - 1).Bottom + 30)
            Else
                .Location = New Point(2, 2)
            End If
        End With
        With panel1(counterpanel)
            .AutoScroll = True
            .Anchor = AnchorStyles.Left
            .BorderStyle = BorderStyle.Fixed3D
            .Location = New Point(5, 70)
            .Width = 1075
            .Height = 220
            .AutoScrollMinSize = New Point(2, 1233)
            .BackColor = Color.Coral
            .Visible = True

        End With
        If counterpanel >= 0 Then
            Me.supprim_phase.Enabled = True
        Else
            Me.supprim_phase.Enabled = False
        End If
        With Richtextbox200(counterpanel)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(150, 10)
            .Width = 300
            .Height = 25
            .Visible = False
            .Multiline = False
            .Tag = counterpanel
        End With
        ReDim Preserve countercombo(counterpanel)
        countercombo(counterpanel).countitem = 0
        counterpanel = counterpanel + 1
        'Me.Refresh()
    End Sub

    Private Sub ajout_ligne_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim index As Integer
        index = countercombo(sender.tag).countitem
        'ajouter le combo à son vecteur le reserved word "preserve" indique qu'on aggrandit le vecteur 
        'sans  effacer l'ancien 
        ReDim Preserve countercombo(sender.tag).combobox0(index)
        ReDim Preserve countercombo(sender.tag).listtype(index)
        ReDim Preserve countercombo(sender.tag).listtype2(index)
        ReDim Preserve countercombo(sender.tag).listtype3(index)
        ReDim Preserve countercombo(sender.tag).Richtextbox0(index)
        ReDim Preserve countercombo(sender.tag).combobox200(index)
        ReDim Preserve countercombo(sender.tag).combobox300(index)
        ReDim Preserve countercombo(sender.tag).RichTextBox400(index)
        ReDim Preserve countercombo(sender.tag).label100(index)
        ReDim Preserve countercombo(sender.tag).Richtextbox100(index)
        'ReDim Preserve scrollbarvert(index) 
        countercombo(sender.tag).combobox0(index) = New ComboBox
        countercombo(sender.tag).listtype(index) = New ComboBox
        countercombo(sender.tag).listtype2(index) = New RichTextBox
        countercombo(sender.tag).listtype3(index) = New RichTextBox
        countercombo(sender.tag).Richtextbox0(index) = New RichTextBox
        countercombo(sender.tag).combobox200(index) = New ComboBox
        countercombo(sender.tag).combobox300(index) = New ComboBox
        countercombo(sender.tag).RichTextBox400(index) = New RichTextBox
        countercombo(sender.tag).label100(index) = New Label
        countercombo(sender.tag).Richtextbox100(index) = New RichTextBox
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).listtype(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).listtype2(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).listtype3(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).combobox0(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).Richtextbox0(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).Richtextbox100(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).combobox200(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).combobox300(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).RichTextBox400(index))
        panel1(sender.tag).Controls.Add(countercombo(sender.tag).label100(index))
        With countercombo(sender.tag).Richtextbox0(index)
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Width = 228
            .Height = countercombo(sender.tag).combobox0(index).Height * 2
            If index > 0 Then
                .Location = New Point(4, countercombo(sender.tag).Richtextbox0(index - 1).Bottom + 10)
            Else
                .Location = New Point(2, 2)
            End If
            .Visible = True
            .Tag = Str(sender.tag) & "-" & Str(index)
            '.Anchor = AnchorStyles.Left 
        End With
        With countercombo(sender.tag).combobox0(index)
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Items.Add("")
            .Items.Add("Maillage")
            .Items.Add("Bilan M.C.I")
            .Items.Add("Condensation de modèle")
            .Items.Add("Checks")
            .Items.Add("Analyses Modales")
            .Items.Add("Analyses Statiques")
            .Items.Add("Analyses Dynamiques")
            .Items.Add("Sorties")
            .Items.Add("Livrables")
            .Items.Add("Management")
            .Items.Add("Autres ...")
            .BackColor = Color.Azure
            '.Anchor = AnchorStyles.Left 
            .Location = New Point(countercombo(sender.tag).Richtextbox0(index).Right + 10, countercombo(sender.tag).Richtextbox0(index).Top + 10)
            measure.Text = "Condensation de modèle"
            .Width = measure.PreferredWidth * 1.2
            .Tag = Str(sender.tag) & "-" & Str(index)
            .Visible = True
            .DropDownStyle = ComboBoxStyle.DropDownList
            AddHandler .SelectedIndexChanged, AddressOf combobox0_SelectedIndexChanged
        End With
        With countercombo(sender.tag).listtype(index)
            '.Anchor = AnchorStyles.Left 
            .Width = 70
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).combobox0(index).Right + 30, countercombo(sender.tag).combobox0(index).Top)
            ' .BorderStyle = BorderStyle.Fixed3D 
            .Visible = True
            measure.Text = "1000 h"
            .Width = measure.PreferredWidth * 1.3
            .DropDownStyle = ComboBoxStyle.DropDownList
            .Tag = Str(sender.tag) & "-" & Str(index)
            AddHandler .SelectedIndexChanged, AddressOf listtype_SelectedIndexChanged
        End With
        With countercombo(sender.tag).listtype2(index)
            ' .Anchor = AnchorStyles.Left 
            measure.Text = "1000 h"
            .Width = measure.PreferredWidth * 1.3
            .Height = countercombo(sender.tag).combobox0(index).Height
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).combobox0(index).Right + 30, countercombo(sender.tag).combobox0(index).Top)
            .BorderStyle = BorderStyle.Fixed3D
            .Visible = False
            .Multiline = False
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        With countercombo(sender.tag).listtype3(index)
            '.Anchor = AnchorStyles.Left 
            .Width = 130
            .Height = countercombo(sender.tag).combobox0(index).Height
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(310, countercombo(sender.tag).combobox0(index).Top)
            .BorderStyle = BorderStyle.Fixed3D
            .Visible = False
            .Multiline = False
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        
        With countercombo(sender.tag).combobox200(index)
            '.Anchor = AnchorStyles.Left 
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).listtype(index).Right + 10, countercombo(sender.tag).listtype(index).Top)
            ' .BorderStyle = BorderStyle.Fixed3D 
            .Visible = True
            .DropDownStyle = ComboBoxStyle.DropDownList
            measure.Text = "Trés Difficile"
            .Width = measure.PreferredWidth * 1.1
            .Items.Add("")
            .Items.Add("Facile")
            .Items.Add("Peu Difficile")
            .Items.Add("Difficile")
            .Items.Add("Très Difficile")
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        With countercombo(sender.tag).combobox300(index)
            '.Anchor = AnchorStyles.Left 
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).combobox200(index).Right + 10, countercombo(sender.tag).combobox200(index).Top)
            ' .BorderStyle = BorderStyle.Fixed3D 
            .Visible = True
            .DropDownStyle = ComboBoxStyle.DropDownList
            measure.Text = "Peu Mature"
            .Width = measure.PreferredWidth * 1.1
            .Items.Add("")
            .Items.Add("Pas Mature")
            .Items.Add("Peu Mature")
            .Items.Add("Mature")
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        With countercombo(sender.tag).RichTextBox400(index)
            '.Anchor = AnchorStyles.Left 
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).combobox300(index).Right + 10, countercombo(sender.tag).combobox300(index).Top)
            ' .BorderStyle = BorderStyle.Fixed3D 
            .Visible = True
            measure.Text = "20.00"
            .Width = measure.PreferredWidth * 1.2
            .Height = countercombo(sender.tag).combobox0(index).Height
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        With countercombo(sender.tag).label100(index)
            '.Anchor = AnchorStyles.Left 
            .Width = 50
            .Font = New Font("arial", 12, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).RichTextBox400(index).Right + 10, countercombo(sender.tag).RichTextBox400(index).Top)
            .BorderStyle = BorderStyle.Fixed3D
            .Visible = True
            .Height = countercombo(sender.tag).combobox0(index).Height
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        With countercombo(sender.tag).Richtextbox100(index)
            '.Anchor = AnchorStyles.Left 
            .Font = New Font("arial", 10, FontStyle.Bold, GraphicsUnit.Pixel)
            .Location = New Point(countercombo(sender.tag).label100(index).Right + 10, countercombo(sender.tag).Richtextbox0(index).Top)
            .Width = 220
            .Height = countercombo(sender.tag).combobox0(index).Height * 2
            ' .BorderStyle = BorderStyle.Fixed3D 
            .Visible = True
            .Tag = Str(sender.tag) & "-" & Str(index)
        End With
        countercombo(sender.tag).countitem = countercombo(sender.tag).countitem + 1
    End Sub

    Private Sub listtype_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim indexes(1) As String
        Dim thistag As String
        Dim indexpanel As Integer
        Dim indexitem As Integer
        thistag = sender.tag
        indexes = thistag.Split("-")
        indexpanel = Double.Parse(indexes(0))
        indexitem = Double.Parse(indexes(1))
        
        Select Case True

            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Maillage" And countercombo(indexpanel).listtype(indexitem).SelectedItem "20 h"
                label1010.Text = "Configuration type  : 1"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Maillage" And countercombo(indexpanel).listtype(indexitem).SelectedItem "30 h"
                label1010.Text = "Configuration type  : 2"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Maillage" And countercombo(indexpanel).listtype(indexitem).SelectedItem "50 h"
                label1010.Text = "Configuration type  : 3"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Maillage" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 4"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Maillage" And countercombo(indexpanel).listtype(indexitem).SelectedItem "160 h"
                label1010.Text = "Configuration type  : 5"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Bilan M.C.I" And countercombo(indexpanel).listtype(indexitem).SelectedItem "4 h"
                label1010.Text = "Configuration type  : 6"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Bilan M.C.I" And countercombo(indexpanel).listtype(indexitem).SelectedItem "8 h"
                label1010.Text = "Configuration type  : 7"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Bilan M.C.I" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 8"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Bilan M.C.I" And countercombo(indexpanel).listtype(indexitem).SelectedItem "20 h"
                label1010.Text = "Configuration type  : 9"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Condensation de modèle" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 10"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Condensation de modèle" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 11"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Condensation de modèle" And countercombo(indexpanel).listtype(indexitem).SelectedItem "64 h"
                label1010.Text = "Configuration type  : 12"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Condensation de modèle" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 13"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Condensation de modèle" And countercombo(indexpanel).listtype(indexitem).SelectedItem "120 h"
                label1010.Text = "Configuration type  : 14"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Checks" And countercombo(indexpanel).listtype(indexitem).SelectedItem "8 h"
                label1010.Text = "Configuration type  : 15"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Checks" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 16"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Checks" And countercombo(indexpanel).listtype(indexitem).SelectedItem "24 h"
                label1010.Text = "Configuration type  : 17"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Checks" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 18"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Checks" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 19"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Modales" And countercombo(indexpanel).listtype(indexitem).SelectedItem "8 h"
                label1010.Text = "Configuration type  : 20"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Modales" And countercombo(indexpanel).listtype(indexitem).SelectedItem "24 h"
                label1010.Text = "Configuration type  : 21"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Modales" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 22"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Modales" And countercombo(indexpanel).listtype(indexitem).SelectedItem "60 h"
                label1010.Text = "Configuration type  : 23"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Statiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "8 h"
                label1010.Text = "Configuration type  : 24"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Statiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 25"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Statiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 26"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Statiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 27"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Statiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "120 h"
                label1010.Text = "Configuration type  : 28"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Statiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "160 h"
                label1010.Text = "Configuration type  : 29"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Dynamiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 30"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Dynamiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "24 h"
                label1010.Text = "Configuration type  : 31"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Dynamiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 32"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Dynamiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 33"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Analyses Dynamiques" And countercombo(indexpanel).listtype(indexitem).SelectedItem "120 h"
                label1010.Text = "Configuration type  : 34"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Sorties" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 35"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Sorties" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 36"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Sorties" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 37"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Sorties" And countercombo(indexpanel).listtype(indexitem).SelectedItem "120 h"
                label1010.Text = "Configuration type  : 38"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Livrables" And countercombo(indexpanel).listtype(indexitem).SelectedItem "8 h"
                label1010.Text = "Configuration type  : 39"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Livrables" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 40"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Livrables" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 41"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Livrables" And countercombo(indexpanel).listtype(indexitem).SelectedItem "64 h"
                label1010.Text = "Configuration type  : 42"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Livrables" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 43"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "4 h"
                label1010.Text = "Configuration type  : 44"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "8 h"
                label1010.Text = "Configuration type  : 45"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "16 h"
                label1010.Text = "Configuration type  : 46"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "24 h"
                label1010.Text = "Configuration type  : 47"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "40 h"
                label1010.Text = "Configuration type  : 48"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "64 h"
                label1010.Text = "Configuration type  : 49"
            Case countercombo(indexpanel).combobox0(indexitem).SelectedItem "Management" And countercombo(indexpanel).listtype(indexitem).SelectedItem "80 h"
                label1010.Text = "Configuration type  : 50"
        End Select
    End Sub

    Private Sub supprim_phase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles supprim_phase.Click
        'ReDim Preserve panels(counterpanel)
        ' If counterpanel < 1 Then
        'Else
        ' panel2.Controls.Remove(panels(counterpanel - 1))
        ' counterpanel = counterpanel - 1
        'End If


        If counterpanel > 0 Then
            panel2.Controls.Remove(panels(counterpanel - 1))
            counterpanel = counterpanel - 1
            ReDim Preserve panels(counterpanel)
        End If
        If counterpanel > 0 Then
            Me.supprim_phase.Enabled = True
        Else
            Me.supprim_phase.Enabled = False
        End If
    End Sub

    Private Sub supprim_ligne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Dim indexpanel As Integer
        Dim indexitem As Integer

        indexpanel = sender.tag
        indexitem = countercombo(indexpanel).countitem - 1
        If countercombo(indexpanel).countitem > 0 Then
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).listtype(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).listtype2(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).listtype3(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).combobox0(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).Richtextbox0(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).Richtextbox100(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).combobox200(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).combobox300(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).RichTextBox400(indexitem))
            panel1(sender.tag).Controls.Remove(countercombo(indexpanel).label100(indexitem))
            countercombo(indexpanel).countitem = countercombo(indexpanel).countitem - 1

        End If
    End Sub

    Private Sub combobox0_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim indexes(1) As String
        Dim thistag As String
        Dim indexpanel As Integer
        Dim indexitem As Integer
        thistag = sender.tag
        indexes = thistag.Split("-")
        indexpanel = Double.Parse(indexes(0))
        indexitem = Double.Parse(indexes(1))
        label1010.Text = ""
        With countercombo(indexpanel).combobox0(indexitem)
            measure.Text = "Condensation modèle"
            .Width = measure.PreferredWidth * 1.4
        End With
        With countercombo(indexpanel).listtype(indexitem)
            .Visible = True
            measure.Text = "1000 h"
            .Width = measure.PreferredWidth * 1.3
        End With
        With countercombo(indexpanel).listtype2(indexitem)
            .Visible = False
        End With
        With countercombo(indexpanel).listtype3(indexitem)
            .Visible = False
        End With
        countercombo(indexpanel).listtype(indexitem).Items.Clear()
        Select Case countercombo(indexpanel).combobox0(indexitem).SelectedItem
            Case ""
                countercombo(indexpanel).listtype(indexitem).Items.Add("")
            Case "Maillage"
                countercombo(indexpanel).listtype(indexitem).Items.Add("20 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("30 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("50 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("160 h")
            Case "Bilan M.C.I"
                countercombo(indexpanel).listtype(indexitem).Items.Add("4 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("8 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("20 h")
            Case "Condensation de modèle"
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("64 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("120 h")
            Case "Checks"
                countercombo(indexpanel).listtype(indexitem).Items.Add("8 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("24 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")

            Case "Analyses Modales"
                countercombo(indexpanel).listtype(indexitem).Items.Add("8 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("24 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("60 h")

            Case "Analyses Statiques"
                countercombo(indexpanel).listtype(indexitem).Items.Add("8 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("120 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("160 h")

            Case "Analyses Dynamiques"
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("24 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("120 h")

            Case "Sorties"
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("120 h")

            Case "Livrables"
                countercombo(indexpanel).listtype(indexitem).Items.Add("8 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("64 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")

            Case "Management"
                countercombo(indexpanel).listtype(indexitem).Items.Add("4 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("8 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("16 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("24 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("40 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("64 h")
                countercombo(indexpanel).listtype(indexitem).Items.Add("80 h")
            Case "Autres ..."
                With countercombo(indexpanel).combobox0(indexitem)
                    measure.Text = "Autres ..."
                    .Width = measure.PreferredWidth * 1.1
                End With
                With countercombo(indexpanel).listtype(indexitem)
                    .Visible = False
                End With
                With countercombo(indexpanel).listtype2(indexitem)
                    .Visible = True
                End With
                With countercombo(indexpanel).listtype3(indexitem)
                    .Visible = True
                End With
        End Select
    End Sub

    Private Sub combobox500_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        With Richtextbox200(sender.tag)
            panels(sender.tag).Controls.Add(Richtextbox200(sender.tag))
            .Visible = False
            Richtextbox200(sender.tag).Clear()
        End With
        Select Case combobox500(sender.tag).SelectedItem
            Case "Autre ..."
                With Richtextbox200(sender.tag)
                    panels(sender.tag).Controls.Add(Richtextbox200(sender.tag))
                    .Visible = True
                End With
        End Select
    End Sub

End Class

0