dimanche 31 mai 2020

How to add an dynamically a checkbox element on a Tabcontrol after Tabcontrol.Pages is from GUI Designer?

can i add tabcontroll elements after programm started?

For i = 0 To frmMain.cmbZielSpache.Items.Count - 1

        Dim cBox = New CheckBox()
        cBox.Name = "GEN_" & i
        cBox.Location = New Point(offsetX, offsetY)
        cBox.Text = frmMain.cmbZielSpache.Items(i)

        If frmMain.cmbZielSpache.Items(i) = frmMain.cmbZielSpache.Text Or My.Settings.chkTranslate_normal_alleSprachen = True Then
            cBox.Checked = True
        End If

        offsetX = offsetX + 120

        Me.Controls.Add(cBox)
        AddHandler cBox.CheckedChanged, AddressOf checkChangedHandler

    Next i

Instead of using Me.Controls i wanna add the checkboxes after programm started dynamically.




Aucun commentaire:

Enregistrer un commentaire