Control Tab

  • Thread starter Thread starter Marilu
  • Start date Start date
M

Marilu

Good Morning (..Afternoon, Evening??) All,
I am hoping someone can give me a hand with a most
aggrivating problem.
I have a control tab with TEN tabs. I have named
them "tab0", "tab1", "tab2" . . . "tab9" and when I look
at the properties of the control tab collection, the pages
are listed in order with the name being equal to the
index. I have set the text to "0", "1", "2" . . "9".
When I open the form, the tabs are not in order. And, it
is a different order each time. I have removed all code
from behind the form - just in case I was doing something
inadvertantly to change the order.

I also have two other forms in the same project with ten
tabs each and they work like champs.

Does anyone have any insight to this???

I thank you all in advance for your assistance.

Marilu

PS I AM a subscriber of MSDN and am hoping for an answer
 
It has something to do with design time changes, I think.

I'm not exactly sure what the deal is, but I was having the same
problem.

Say you set up tabs 1,2,3,4,5.

Then you update some properties on tab 3, sometimes it would then (in
the windows code) put tab 3 at the bottom of the declarations, etc and
would look like
1,2,4,5,3.

So, if you keep the declarations in order, and keep them in order in
the tabcontrol.add, you should be all set (But, to me this is still a
bug, needless to say, annoying):

Friend WithEvents tab1 As System.Windows.Forms.TabPage
Friend WithEvents tab2 As System.Windows.Forms.TabPage
Friend WithEvents tab3 As System.Windows.Forms.TabPage
Friend WithEvents tab4 As System.Windows.Forms.TabPage
Friend WithEvents tab5 As System.Windows.Forms.TabPage

....

Me.tab1 = New System.Windows.Forms.TabPage
Me.tab2 = New System.Windows.Forms.TabPage
Me.tab3 = New System.Windows.Forms.TabPage
Me.tab4 = New System.Windows.Forms.TabPage
Me.tab5 = New System.Windows.Forms.TabPage

....

Me.tabMainControl.Controls.Add(Me.tab1)
Me.tabMainControl.Controls.Add(Me.tab2)
Me.tabMainControl.Controls.Add(Me.tab3)
Me.tabMainControl.Controls.Add(Me.tab4)
Me.tabMainControl.Controls.Add(Me.tab5)
 
Back
Top