robertb_NZ
Well-known member
I have a tab control with 4 tabs: let's call them Tab0, Tab1, Tab2, and Tab3. When the form is opened Tab0 is displayed. If I click Tab1 or Tab3 they display normally, but if I click Tab2 Tab0 remains displayed although the tab itself (at the top) shows as Tab2. If I now click Tab0 and then Tab2 again, it now displays properly. It also displays properly if I click Tab3 and then Tab2, but not if I click Tab1 and then Tab2. Once it is displaying correctly, it continues to display correctly whenever Tab2 is clicked until the form is closed.
In researching this problem I added this code: -
For tabs 0, 1, and 3, and when Tab2 is correctly displayed both debug messages appear. When Tab2 is incorrectly displayed only the "Selected" message appears.
I am using VS2010 and VB.NET 4.0.
Any ideas on how I solve this problem?
Thank you, Robert.
In researching this problem I added this code: -
Private Sub TabControl1_Selected(sender As Object, e As System.Windows.Forms.TabControlEventArgs) Handles TabControl1.Selected
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
Debug.Print("Selected " & TabControl1.SelectedIndex)
End SubPrivate Sub TabControl1_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
Debug.Print("Changed " & TabControl1.SelectedIndex)
End SubFor tabs 0, 1, and 3, and when Tab2 is correctly displayed both debug messages appear. When Tab2 is incorrectly displayed only the "Selected" message appears.
I am using VS2010 and VB.NET 4.0.
Any ideas on how I solve this problem?
Thank you, Robert.