checkbox.remove dans un groupbox
Bonjour,
J'aimerai faire apparaitre un new checkbox si j'ai coché un case dans un autre groupbox mais egalement qu'il disparaisse si je decoche.
Mon code actuel ne fonctionne pas et je ne trouve pas de solution.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
Private Sub CheckBoxVoyant1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxVoyant1.CheckedChanged
Dim CheckBox1 As New CheckBox()
CheckBox1.Location = New Point(6, 24)
CheckBox1.Text = "test"
If CheckBoxVoyant1.Checked Then
GroupBoxQuestion.Controls.Add(CheckBox1)
End If
If CheckBoxVoyant1.Checked = False Then GroupBoxQuestion.Controls.Remove(CheckBox1)
End Sub |
Aidez moi s'il vous plait