Bombdrop
Jun 22nd, 2006, 06:41 AM
Hi all I' working on an app that will show contact info of clients, the problem arrises is that some clients have have more than one contact.
I decided the best way to sho the data would be via a tabcontrol which statrs of with one tabpage with 2 text boxes and 2 lables. holding contact name and address. now if there is more than one contact i would then do the following
TabPage tab ;
foreach(Control C in tabPage1.Controls){
MessageBox.Show(C.Name.ToString());
}
tab = this.tabPage1;
foreach(Control C in tab.Controls){
MessageBox.Show(C.Name.ToString());
}
tabControl1.TabPages.Add(tab);
this does add the new tab and the for each says it contains the controls and I get no errors but the controls are not visable. I beleive it's due to the fact the names of the controls on the newly add tab conflict with the previous control names.
Can anyone please help me achive my goal of add idetincle tabspages to a tab control at run time.
Many thanks
I decided the best way to sho the data would be via a tabcontrol which statrs of with one tabpage with 2 text boxes and 2 lables. holding contact name and address. now if there is more than one contact i would then do the following
TabPage tab ;
foreach(Control C in tabPage1.Controls){
MessageBox.Show(C.Name.ToString());
}
tab = this.tabPage1;
foreach(Control C in tab.Controls){
MessageBox.Show(C.Name.ToString());
}
tabControl1.TabPages.Add(tab);
this does add the new tab and the for each says it contains the controls and I get no errors but the controls are not visable. I beleive it's due to the fact the names of the controls on the newly add tab conflict with the previous control names.
Can anyone please help me achive my goal of add idetincle tabspages to a tab control at run time.
Many thanks