Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27184

Adding A TabPage From Its Index

$
0
0
Below is an attempt to make a button that will remove all tabpages, then add them back through their indexes.
StartPage is the starting index, and Current Pages is the total tabpages.

How should this rewritten to work properly, or what line(s) of code should be added to the [Add TabPage With The Index of c]
comment.

Code:

Public Class Form1   

Dim StartPage As Integer = 0
Dim CurrentPages As Integer = 6

            Try
                For Each T As TabPage In TC1.TabPages
                    TC1.TabPages.Remove(T)
                Next
                Do Until StartPage = CurrentPages
                    StartPage += 1
                    '' [Add TabPage With The Index of StartPages Integer]
                Loop
                If StartPage = CurrentPages Then
                    StartPage = 0
                End If
            Catch
            End Try

End Class


Viewing all articles
Browse latest Browse all 27184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>