Dim tab As WinForm.TabControl = e.form.controls("tabcontrol1") static idx As Integer = tab.SelectedIndex Dim flag As Boolean = False Do While flag = False If idx < tab.TabPages.count-1 Then If tab.TabPages(idx+1).Visible = True Then tab.SelectedIndex = idx+1 idx += 1 flag = True Else idx += 1 End If Else idx = -1 End If Loop