Hide
This requirement is actually the TabControl control will have a lot of pre-made page page, every time the software startup is not possible to display all the pages, now think of a relatively simple way to solve the problem
First define a list collection to store the TabPages collection in the TabControl
Then load the parent of all the page is set to NULL, so it is not displayed, but also want to display the corresponding Page.parent=tabcontrol control on the line
PrivateList<tabpage> temptabpages=NULL;--------------------------------------------------------temptabpages=NewList<tabpage>(); foreach(TabPage pageinch This. Ftabcontrol_main.tabpages) {page. Parent=NULL; Temptabpages.add (page); } -----------------when you use it.if(TreeViewManageMenu.SelectedNode.Text = ="Instance Settings") { //MessageBox.Show ("0"); foreach(TabPage pageinch This. Temptabpages) { if(page. Text = ="Instance Settings") {page. Parent=Ftabcontrol_main; } } }
C # Control TabControl Hide Page