Mysterious moving tabs

  • Thread starter Thread starter KC
  • Start date Start date
K

KC

Has anyone else had the problem of tabs in a tab control changing position
on their own? Sometimes I run my app (in debug mode) and some of the tabs
are in completely different positions. I can shift them back in the tab
control no problem, but it ain't suppose to be doing that in the first
place.
 
Hi KC,

Very known bug it has to do with the Z order. I said to somebody try it with
setting the pages in a loop to BringToFront, I am curious if that works,
because I never tried that.

Maybe you can try?

Cor

....
 
This is a known bug.

You can easily fix that once for all with simple code. You can use the
following code to completely remove TabPages from the TabControl in re-add
them in the correct order. It is important to notice that the content of
TabPages will not be affected.
With TabControl1.TabPages
.Clear()
.Add(TabPage1)
.Add(TabPage2)
.Add(TabPage3)
.Add(TabPage4)
.Add(TabPage5)
End With
This code needs to be placed anywhere after the call to InitializeComponent.
The Form's Load event is a good place for that.
--

HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc.(www.s2i.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top