Morning,
ive created 4 new tabs in the ultratabcontrol. Through VB.NET code how do i get to the next tab using a next button?
ultratabcontrol.selectedtab = ??????
ta
Came across this when looking for something. Your code above does not work if any of the tabs are invisible as the selected tab becomes nothing so it crashes when checking the index. It also don't work right well even if it did not crash because you end up on the hidden tab being selected, rather than the next non-hidden task.
Here is what I suggest.
Public Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click
Dim visInd As Integer
visInd = uTabOptions.ActiveTab.VisibleIndex
Do
visInd += 1
uTabOptions.SelectedTab = uTabOptions.Tabs(visInd)
Loop Until uTabOptions.SelectedTab IsNot Nothing Or visInd >= uTabOptions.Tabs.Count
End Sub
Public Sub btnback_Click(sender As System.Object, e As System.EventArgs) Handles btnback.Click
visInd -= 1
Loop Until uTabOptions.SelectedTab IsNot Nothing Or visInd <= 0
Hello MisterRafter,
I am glad that I was able to assist you here.
Please feel free to let us know if you have any other questions in the future.
Danko thanks,
i did convert your code into vb.net and got it to run. Thanks for your code explanation, all makes sense now.
love this place always very helpful.
Here is the same code in VB :
Private Sub UltraButton1_Click(sender As System.Object, e As System.EventArgs) Handles UltraButton1.Click If UltraTabControl1.SelectedTab IsNot Nothing AndAlso UltraTabControl1.SelectedTab.Index + 1 < UltraTabControl1.Tabs.Count Then UltraTabControl1.Tabs(UltraTabControl1.SelectedTab.Index + 1).Selected = True End If End Sub
perfect that works. Star! thanks
now i need to understand the code you provided. Im fairly new to VB.net :)