Hide

SftTabs/OCX 6.5 - Tab Control for VB6

Display
Print

TabForm Sample (VB6)

This sample illustrates implementing a tab control with tabs A through Z, controlling the contents of a list box.

The source code is located at C:\Program Files (x86)\Softelvdm\SftTabs OCX 6.5\Samples\TabForm\Form1.frm or C:\Program Files\Softelvdm\SftTabs OCX 6.5\Samples\TabForm\Form1.frm (on 32-bit Windows versions).

Option Explicit

Private Sub Command1_Click()
    End
End Sub

Private Sub Form_Load()
    ' Resize the tab control (height) to its best size
    SftTabs1.MakeNaturalSize
    ' Initialize tab control as if user clicked on first tab
    Call SftTabs1_Switched
End Sub

Private Sub SftTabs1_Switched()
    Dim Pref As String
    Dim i As Integer

    List1.Clear
    ' get the tab text of the active tab (without '&')
    Pref = Mid$(SftTabs1.Tab(SftTabs1.Tabs.Current).Text, 2)
    List1.AddItem ("Display all items starting with the letter " & Pref)
    ' Add some sample items to the list box
    For i = 1 To 20
        List1.AddItem (Pref & " " & i)
    Next
End Sub

Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.