DaviiD2010
Programmer
Hi all . I got a tab in my webbrowser and a listbox. Every time i click a listbox item a html loads in to my new tab inside webbrowser controle. Now i want to add a close button to each tabs. so when i press that button i want that tab closes. I placed the code for adding new tabs when listbox item is getting clicked. Looking forward for some help.Thanks
Code:
Private Sub List1_Click()
'
' populate SSTab1, WB1(nnTABs)
'
With List2
If Option1.Value = True Then
v1 = List1.ListIndex
Else
v1 = List1.ListIndex
End If
v2 = .List(v1)
nnTABS = nnTABS + 1
' Tab
With SSTab1
.Tabs = nnTABS
.Tab = nnTABS - 1
If Option1.Value = True Then
.Caption = Left(v2, InStr(v2, ".") - 1)
Else
.Caption = List1.List(List1.ListIndex) & ":" & List1.ListIndex
End If
End With
' WB1
If nnTABS > 1 Then
Load WB1(nnTABS - 1)
End If
With WB1(nnTABS - 1)
.Container = SSTab1
.Top = 1500
.Left = 100
.Height = 4300
.Width = 5500
.Visible = True
.StatusBar = True
.MenuBar = True
If Option1.Value = True Then
'MsgBox "wow"
.Navigate2 App.Path & "/" & "singers/" & v2
Else
.Navigate2 App.Path & "/" & v2
End If
End With
End With
End Sub