|
-
Jun 10th, 2004, 01:24 PM
#1
Thread Starter
Lively Member
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
-
Jun 10th, 2004, 02:31 PM
#2
Frenzied Member
Do a
TabControl1.Controls.Remove(TabControl1.Controls(ConvertInteger))
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jun 10th, 2004, 02:50 PM
#3
Thread Starter
Lively Member
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
-
Jun 10th, 2004, 03:04 PM
#4
Frenzied Member
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.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jun 10th, 2004, 03:12 PM
#5
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
-
Jun 11th, 2004, 02:12 AM
#6
Thread Starter
Lively Member
ok !
i try it first
thanks for help me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|