Hi
I wrote this in VB.NET and it works great for my needs..
To call it simply pass the name of the KryptonNavigator and a ";" delimitted string of page titles to display. You can optionally specify the default (selected) page.
Example:
- Code: Select all
ShowNavigatorTabPages(myNavigator; "Main;Reports;Finance;Admin;Assets", "Finance")
This example displays the Main, Reports, Finance, Admin & Assets pages and selects the Finance page.
To display only a single page (and hide all others) just specify the Navigator and the Page title to display
Example:
- Code: Select all
ShowNavigatorTabPages(myNavigator; "Reports")
It was a quick 'n' dirty (but reliable) effort so no laughing

. It's fairly basic and can't cope with page reordering, missing tabs, etc. But it will display the tabpages you specify, hide all others and optionally select a "default" page.
Hope it helps someone out there as this had me stumped for a while!
John
- Code: Select all
Sub ShowNavigatorTabPages(ByVal myKryptonNavigator As KryptonNavigator, ByVal myPageTitlesToShow As String, Optional ByVal myDefaultPage As String = "")
' ==============================================================================================
' ShowNavigatorTabPages. V1.0.0 - May 2008.
' Shows (and Hides) Tabs on the KryptonNavigator & optionally selects a Page
' ----------------------------------------------------------------------------------------------
' In: myKryptonNavigator Krypton Navigator containing the Tabs to Display
' myPageTitlesToShow ";" Delimitted string containing the Titles of the Tab Pages you
' wish to view - all others are hidden by default
' myDefaultPage Title of the Krypton Tab Page you wish to SELECT by default (Optional)
' ==============================================================================================
' ****************************************
' ** Get a List of the Pages to Display **
' ****************************************
Dim arrPage As String() = Strings.Split(myPageTitlesToShow, ";")
With myKryptonNavigator
' *********************************************************************************
' ** Ensure all NavPages are hidden EXCEPT those supplied in the delimitted list **
' *********************************************************************************
For Each KryptonPage In .Pages
Dim blnVisible As Boolean = False
For intIndex = 0 To UBound(arrPage)
If LCase(arrPage(intIndex)) = LCase(KryptonPage.Text) Then
blnVisible = True
Exit For
End If
Next
KryptonPage.Visible = blnVisible
Next
' ************************************************************************************
' ** Get the Default Tab Page (if supplied) or assume the first page is the default **
' ************************************************************************************
If myDefaultPage = "" Then myDefaultPage = arrPage(0)
For Each KryptonPage In .Pages
If LCase(KryptonPage.Text) = LCase(myDefaultPage) Then
.SelectedPage = KryptonPage
Exit For
End If
Next
' **************************************************
' ** If viewing single tab, lose the Tab Headers! **
' **************************************************
.NavigatorMode = IIf(UBound(arrPage) > 0, NavigatorMode.BarTabGroup, NavigatorMode.Group)
Application.DoEvents()
End With
' **************
' ** Clean Up **
' **************
arrPage = Nothing
End Sub ' ShowNavigatorTabPages
Attached File:VB.NET 2008