Reputation: 1434
I have a tab id in a string:
string tab_name = "tabPage1";
The tab id comes from an sql db, so it's not fixed as above. How to remove it at the program start? This is most likely incorrect:
tabControl1.TabPages.Remove(tab_name);
Upvotes: 0
Views: 372
Reputation: 2086
Set a Name
property to each TabPage
:
tabControl1.TabPages[0].Name = "tabPage1";
// ...
Remove TabPage
later by it's Name
:
tabControl1.TabPages.RemoveByKey("tabPage1");
Upvotes: 2