Dim TabIndex As Integer = e.form.Controls("TabControl1").SelectedIndex Dim control As WinForm.TabControl = e.form.Controls("TabControl1") For i As Integer = control.TabPages.Count - 1 To 0 Step -1 If i <> tabIndex Then control.TabPages.Delete(i) End If Next