Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tabless TabStrip
Message
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00850262
Message ID:
00850913
Views:
15
>>Is there any way to remove the tabs from a TabStrip control?
>>
>>I want to create a page sequence controlled by navigator buttons.
>>
>>I'm using VB6. I can do it in .NET but cannot find out how in VB6 (client constraints prevent me using .NET).
>>
>>TIA,
>
>You can create the facade of this through frames. You can make your pages as you want them to appear. After you get the first one done use the property sheet to move the sheet off the left of the form. I use the following. Add two command buttons (cmdPrevious and cmdNext) and an assortment of frames with sequential numbers in the .tag property. these numbers will be your page order. You could hard code the framenames but this allows reordering and additions.
>
>
>' Begin form code
>Option Explicit
>
>Private m_iPage As Integer    ' This is an integer to indicate current page
>
>Private Sub SetFrames()
>    If Not SetFrame Then
>        SetFrame
>    End If
>End Sub
>
>Private Function SetFrame() As Boolean
>    Dim FraFound As Boolean
>    Dim fra As Frame
>
>    For Each fra In Me.Controls
>        On Error GoTo bAIL
>        If Val(fra.Tag) = m_iPage Then
>            fra.Move 15, 15 ' move is faster than .left etc.
>            FraFound = True
>            fra.Caption = "tag " & fra.Tag
>        Else
>            fra.Move ((-100) - (fra.Width)), 15
>        End If
>    Next
>bAIL:
>
>    If Not FraFound Then
>        m_iPage = 1   ' We obviously went over or under
>    End If
>    SetFrame = FraFound ' Return
>
>End Function
>
>Private Sub cmdNext_Click()
>    m_iPage = m_iPage + 1
>    SetFrames
>End Sub
>
>Private Sub cmdPrevious_Click()
>    m_iPage = m_iPage - 1
>    SetFrames
>End Sub
>
>Private Sub Form_Load()
>    m_iPage = m_iPage + 1
>    SetFrames
>End Sub
>'End form code.
>
>
>I realize there are limitations to this method, however, it does meet the need.

Have just done a quick test in VB - works well.

Create a frame control array (called fraWizard). Design your form oversize and place each extra frame off to the right. When you build/run, you resize your form to the correct size (leaving the design-time stuff off to the right).

Here is the code page from my form...
Dim nFrame As Integer

Private Sub cmdBack_Click()
    If nFrame > 0 Then
        nFrame = nFrame - 1
        ChangeFrame
    End If
End Sub

Private Sub cmdNext_Click()
    If nFrame < fraWizard.Count - 1 Then
        nFrame = nFrame + 1
        ChangeFrame
    End If
End Sub

Private Sub Form_Load()
    Dim nLoop As Integer

    ' Reposition all other frames to sit in same position as first
    For nLoop = 1 To fraWizard.Count - 1
        fraWizard(nLoop).Left = fraWizard(0).Left
        fraWizard(nLoop).Top = fraWizard(0).Top
    Next

    ChangeFrame
    
End Sub

Private Sub ChangeFrame()
    Dim nLoop As Integer
    
    ' Change visibility of frames (set all invisible except current)
    For nLoop = 0 To fraWizard.Count - 1
        fraWizard(nLoop).Visible = (nLoop = nFrame)
    Next
    
    cmdBack.Enabled = (nFrame > 0)
    cmdNext.Enabled = (nFrame < fraWizard.Count - 1)

End Sub
Works great - I will use this based on your suggestion.

Thanks,
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform