Results 1 to 6 of 6

Thread: Help !!!!!!!!!!!!!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108

    Unhappy 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

  2. #2
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618
    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108
    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

  4. #4
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618
    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.

  5. #5
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    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

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108
    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
  •  



Click Here to Expand Forum to Full Width