Hi All,
Just be aware - I'm fully aware that I'm being dense... it's a while since I've programmed and I'm trying to get back into it.
I have a TabControl which I would like to be controlled by a Numeric up/down.. here's the code I've come up with:
However, rather than add the tab named "tabName1" it adds a blank tab, seemingly named "tabName1".
If I try this with a literal of "tabName1" rather than var k this works... any ideas??
Just be aware - I'm fully aware that I'm being dense... it's a while since I've programmed and I'm trying to get back into it.
I have a TabControl which I would like to be controlled by a Numeric up/down.. here's the code I've come up with:
Code:
private void populateTabs()
{
string numberOfTabs;
numberOfTabs = numberOfAdditionalTabs.Value.ToString();
for (int i = 0; i <= Convert.ToInt32(numberOfTabs); i++)
{
int j;
j = i;
j += 2;
string k;
k = "tabName" + j;
tabsAdditionalTabs.TabPages.Insert(i, k);
}
}
If I try this with a literal of "tabName1" rather than var k this works... any ideas??