so i’ve been searching the net, and I’ve found some code to add controls to a tab, but I need to add many controls to the new tab.
Here is what I’ve got:
A new player tab, that acesses the database and adds a new player, with all the data.
4 Player tabs, with a combobox in the bottom, on FormLoad or a new player is created, this box is updated with all the current palyers in the database, upon selecting one, all his data is displyed.
What I want to do is remove the 4 tabs and add a button on the new player tab, with a combobox to select players and a button to confirm, when the button is pressed, it should generate a new tab, exactly like the 4 old ones.
there is by any chance a way to hide from the user one of the old 4 tabs and every time I create a new one, copy all controls from the hidden one?
Edit: where is the code I’ve found for adding controls:
Button button1 = new Button();
button1.Location = new Point(20, 10);
button1.Text = "Click Me";
tabPage1.Controls.Add(button1)
but what i want is like:
new tab tabx = sampletab
tabcontrol.tabs.add(tabx);
But this only copies the title, not the controls
I probably would create a
UserControlhandling a single player’s data. Then you only have to add a single control to each new tab.