Cycle through some tab contols...

Posted on 2005-04-04
Medium Priority
Last Modified: 2008-02-01
Hello experts,

Part of my interface works by hiding various tabs depending on a user selection.

I've written the following pseudo-code, but i cant find the necessary syntax to actually make it work in VB.net.
Tabs_FrmMain is a standard tab control.

Sub SelectTabPage(ByVal intPage As Integer)
        If (intPage >= 0 And intPage < Me.Tabs_FrmMain.TabCount()) Then 'tab is in range
            Dim x As Integer
            For x = 0 To Me.Tabs_FrmMain.TabCount() Step 1            
                Me.Tabs_FrmMain.TabPage[x].Visible = False
            Me.Tabs_FrmMain.TabPage[intPage].Visible = True
        Else 'invalid tab selected
        End If
End Sub

any takes?
Question by:mnamiri
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Lacutah earned 1000 total points
ID: 13703291
Funny you should ask, I answered this one a few days ago...  Essentially you can't "show" and "hide" tabs inside a tab control (don't know why, but you can't)  However, you can remove them from the tab pages collection and re-add them back later.


Author Comment

ID: 13712098

you said the following in your previous answer... (unfortunately my VB skills still arn't up to speed), but how do you create the array with the tab pages copied into it. etc. i guess what im searching for is a bit or a turn-key solution.

I've run into this too.  TabControls contain TabPages.  The trick is to remove the pages in question, and add them back into the TabControl if needed.

For example:
Private MyHiddenPages as New ArrayList()
Sub From1_Load(...)
      if IsGuesUser then
          'Add page to ArrayList object, so can restore later..
          'Remove page from tabcontrol
      end if
End Sub

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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 …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

765 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