Get Tag from TabControl.TabPages VB 2008

In code I have set the tag of a tabpage using the following code.
 ft.TabRacing.TabPages(c).Tag = view.Item("SessionTypeID")
This would be similar to form.TabControl.TabPages(Index).Tag = 2

Now I am trying to retrieve this value from the tab and keep getting Object reference not set...
Dim s As String = Me.TabRacing.TabPages(t).Tag.ToString

WHY is this not working??????


SheritlwAsked:
Who is Participating?
 
SheritlwAuthor Commented:
Found the solution

For Each ctrl As TabPage In TabControl1.TabPages
            If ctrl.Text.Length > 0 And ctrl.Text <> "Results" Then
                fpGrdResults.ActiveSheet.AddRows(c, 1)
                fpGrdResults.ActiveSheet.SetText(c, 3, ctrl.Text)
                fpGrdResults.ActiveSheet.SetTag(c, 3, CType(ctrl.Tag, Integer))
                c = c + 1
            End If
        Next
0
 
JosephGermanOcenaCommented:
can you post your code?
0
 
SheritlwAuthor Commented:
The code is included in my question

ft.TabRacing.TabPages(c).Tag = view.Item("SessionTypeID")
This would be similar to form.TabControl.TabPages(Index).Tag = 2

Trying to get tag
Dim s As String = Me.TabRacing.TabPages(t).Tag.ToString
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.