HeaderPane
Main
Hide
Share Link
Print

Delete Method, SftTabsTabs Object

Deletes an existing tab.

Syntax

VBobject.Delete(ByVal TabIndex As Integer)

object

A SftTabsTabs object.

TabIndex

The zero-based index of the tab to delete.

Comments

The Delete method deletes an existing tab.

A tab can only be deleted if the tab has no associated controls in the tab control's client area.

Tabs.Clear is used to delete all tabs from the tab control.

Example

Private Sub Form_Load()
    Dim TabIndex As Integer, DeleteIndex As Integer
    With SftTabs1
        .BulkUpdate = True
        .Tabs.Clear
        TabIndex = .Tabs.Add("First Tab")
        DeleteIndex = .Tabs.Add("Tab to be deleted")
        TabIndex = .Tabs.Add("Second Tab")
        .Tabs.Delete DeleteIndex
        .BulkUpdate = False
    End With
End Sub

Examples

VB6 View entire sample code

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

See Also SftTabsTabs Object | Object Hierarchy


Last Updated 11/19/2026 - (email)
© 2026 Softel vdm, Inc.