Deletes an existing tab.
| VB | object.Delete(ByVal TabIndex As Integer) |
object
TabIndex
The zero-based index of the tab to delete.
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.
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
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 SubSee Also SftTabsTabs Object | Object Hierarchy