[Last Call] Learn how to a build a cloud-first strategyRegister Now


Get Tag from TabControl.TabPages VB 2008

Posted on 2009-04-23
Medium Priority
Last Modified: 2012-05-06
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??????

Question by:Sheritlw
  • 2

Expert Comment

ID: 24212924
can you post your code?

Author Comment

ID: 24218395
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

Accepted Solution

Sheritlw earned 0 total points
ID: 24460455
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question