Dim tabc As WinForm.TabControl tabc=e.Form.Controls("TabControl1") Dim str As String str=tabc.SelectedPage.Text
If tabc.SelectedIndex<>0 Then If Forms(str).Opened=True e.Form.controls("table1").visible = False tabc.TabPages.Delete(str) Forms(str).Close End If End If