Hide

SftTabs/OCX 6.5 - Tab Control for VB6

Display
Print

MDITab Sample - Document Form (VB6)

This sample demonstrates the Document form of an MDI application with a tab control used to switch between documents.

Also see MDITab Main Form

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

Private Sub Form_Load()
    Form_Resize
End Sub

Private Sub Form_Resize()
    txtText.Move 100, 100, Me.ScaleWidth - 200, Me.ScaleHeight - 200
End Sub

Private Sub Form_Activate()
    With fMainForm.SftTabs1.Direct
        ' Find the tab that describes this form (we saved a reference
        ' to the form object in the tab's Tag1 property)
        ' We have to make that tab the current tab, because the MDI Child
        ' is now active
        For iTab = 0 To .Tabs.Count - 1
            If .Tab(iTab).Tag1 Is Me Then
                .Tabs.Current = iTab
                Exit For
            End If
        Next
    End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
    With fMainForm.SftTabs1.Direct
        ' Find the tab that describes this form (we saved a reference
        ' to the form object in the tab's Tag1 property)
        ' We have to delete that tab because the MDI Child
        ' is going away
        For iTab = 0 To .Tabs.Count - 1
            If .Tab(iTab).Tag1 Is Me Then
                .Tabs.Delete iTab
                Exit For
            End If
        Next
    End With
End Sub

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