This is a simple Tutorial for TabStrip in VB6 Code
Open New Project using VB6 Language
Then you must need
1. One TabStrip
2. One Texbox for the name of tab you want to add
3. Two Command Button for Adding and Removing Tab
First Press Crtl + T to Open Components
Then Add the Components Microsoft Windows Common Controls 6.0 (SP6) then Click Ok
Now you have the Microsoft Windows Common Controls 6.0 on your Project
Double Click the Command1 Button and Put This Code
- Code:
-
Private Sub Command1_Click()
Dim i As Integer
For i = 1 To TabStrip1.Tabs.Count
If TabStrip1.Tabs(i).Selected = True Then
TabStrip1.Tabs.Add.Caption = Text1.Text '<=== Text1 is The Tab Caption
Exit For
End If
Next i
End Sub
Same Process Double Click the Command2 Button and Put this Code
- Code:
-
Private Sub Command2_Click()
Dim i As Integer
For i = 1 To TabStrip1.Tabs.Count
If TabStrip1.Tabs(i).Selected = True Then ' <=== Selected Tab to Remove
TabStrip1.Tabs.Remove i '<==== Remove Tab
Exit For
End If
Next i
End Sub
Now Try to Run your Simple Project TabStrip Adding Tab With Name and Removing Tab