I have 5 tabs (indexed at 0). Users select what options they want and then I remove the rest of the tabs from the end of the tabcontrol. If they want to add a tab back they can do that also.
My problem is, I need to loop through the tabs in order to remove them.
Lets say a user has selected 4 items, 0 based, so I would need to remove 2 tabs.
As I loop through and remove the tabs, the last index is not longer available so I will get an error.
Is there a way to loop through the tabcount in descending order?
For Each i As Object In Me.lstChkSessions.CheckedItems
s = Me.lstChkSessions.GetItemText(i).ToString
ft.TabRacing.TabPages(c).Text = s
Dim view As DataRowView = Me.lstChkSessions.CheckedItems(c)
ft.TabRacing.TabPages(c).Tag = view.Item("SessionTypeID")
c = c + 1
For p As Integer = c To ft.TabRacing.TabCount - 1