I have a project where I need to add TabPages to a TabControl. I have a Panel with 10 checkboxes on it and I want to replicate that onto each TabPage as it is added.

What I get is it is added to the first page, then when I add a second tabpage, the panel is moved there and not replicationed even though I used the (Add) method.

Any ideas or sample code I can review?

Try this, this could help

Dim pan As Panel
Dim tabpag As TabPage
Dim con As controlname

pan = New Panel
con = New controlname
pan.Controls.Add(con)
tabpag = New TabPage
tabpag.Controls.Add(pan)
TabControl1.Controls.Add(tabpag)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.