-
Help !!!!!!!!!!!!!!
How To Remove the tab page that i selected at the tab control
exmple
Tab 1, Tab 2 and Tab 3
if i want to remove the Tab 2, i using the coding like below
why it pop up to me array out of bound ?
the convertinteger is the tab page number that i want to remove
Me.TabControl1.Controls.RemoveAt(ConvertInteger)
please help me thanx
-
Do a
TabControl1.Controls.Remove(TabControl1.Controls(ConvertInteger))
-
sorry
i only can delete not more that one tab
example tab 1,2.3.4.5.6
after i delete the tab 6 and start to delete the tab 4 it pop up an error say my array out of bound
dont know wat is the problem
and the tab i create in run time
thank you
-
Are you stepping in and making sure your ConvertInteger is a valid number? Array out of bounds means you are trying to remove an element that doesn't exist. Try hardcoding deleting two of them and see what happens.
-
If you are deleting multiple Tabs at the same time and you are using a loop to do the deletion, that could also cause a problem. The tab indexes are automatically regenerated after a move, so if you have 7 tabs and you want to delete tab 3 and 7. If you delete tab 3 first, then tab 7 becomes tab 6 and when you try to delete tab 7, you will get an error.
To avoid this error, you need to delete tab7 first and then tab3. So if you loop from your .Count to 1 Step -1, this will let you delete the tabs correctly
-
ok !
i try it first
thanks for help me