Hiding/dynamically adding a tab page..??
-
tried using tapPage.Hide() but it has no effect, tab page still displays... I'm wanting to show a tabPage2 only when there are processing errors on tabPag1. Is there another way, or a way to dynamically add a tab page to a tab control...??? thanks, vince
-
tried using tapPage.Hide() but it has no effect, tab page still displays... I'm wanting to show a tabPage2 only when there are processing errors on tabPag1. Is there another way, or a way to dynamically add a tab page to a tab control...??? thanks, vince
If the TabControl is named "tabControl" , the code for closing is : // verify if the TabPages exist // if we try to close a non-open tab will have error's if (this.tabControl.TabPages.Count != 0) this.tabControl.TabPages.Remove(this.tabControl.SelectedTab); //SelectedTab is the selected tab tabControl.TabPages[] is the // tab , if you whant other tab
-
If the TabControl is named "tabControl" , the code for closing is : // verify if the TabPages exist // if we try to close a non-open tab will have error's if (this.tabControl.TabPages.Count != 0) this.tabControl.TabPages.Remove(this.tabControl.SelectedTab); //SelectedTab is the selected tab tabControl.TabPages[] is the // tab , if you whant other tab
thanks for the reply, but that's not quite what I'm looking for... I need to have either a hidden tab page that can be unhidden, or the ability to create a tab page with a listbox containing error strings... Don't need to remove a tab page... thanks for any further suggestions..
-
tried using tapPage.Hide() but it has no effect, tab page still displays... I'm wanting to show a tabPage2 only when there are processing errors on tabPag1. Is there another way, or a way to dynamically add a tab page to a tab control...??? thanks, vince
vlusardi wrote: or a way to dynamically add a tab page to a tab control...??? Sure, try something like this, it works:
for(int i = 0; i < 5;i++) { TabPage tbpage = new TabPage("test" + i); this.tabControl1.TabPages.Add(tbpage); }
-Nick Parker