TabPages.Insert does not work as advertised

T

taarheel

OK, so there have been about a million posts on the subject of
showing/hiding and reordering TabPages in TabControls, and all note
that the TabPageCollection class did not expose an Insert method in
..Net 1.1.

But now hallelujah in .Net 2.0 there is a public Insert method on
TabPageCollection. But it's sort of not working for me. I find that
if I insert several TabPages in response to a user action, I only get
the last one I inserted--unless I step through the code very slowly and
examine the tabPages collection after every Insert. If I do that they
all show up fine.

I know this sounds fishy, but I have verified that no spurious events
are occurring to RemoveAt the TabPages I'm missing.

Is anyone else having this problem? MS, is there a known bug here?
Please don't tell me I have to remove and re-add all my TabPages every
time I want to insert one. If that's the case, why did you bother to
expose Insert?
 
C

Chris Dunaway

Perhaps you just need to .Refresh the tab control after you insert a
tab? I tried the insert method on a very simple project and it seemed
to work ok.
 

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

Top