Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Another tabcontrol odditiy

2 views
Skip to first unread message

Earl

unread,
Nov 20, 2004, 10:30:49 PM11/20/04
to
I have 11 tabs that I assign at design-time. Yet their index order seems to
change randomly during run-time, making it impossible to remove tabs that do
not apply for a particular usage. For example, the "Plan" tab is index 9 at
design-time, but during run-time, it might load as 7 or whatever. What do I
not know here?


Darren Shaffer

unread,
Nov 20, 2004, 10:39:27 PM11/20/04
to
Earl,

I've also had this happen. Here's what's going on: you add your
11 tabs to the tabcontrol at design time. Entries for each tab page are
added to the Forms Designer code in the InitializeComponent method
that respect the tabpage indexes you effectively set using the visual
designer.

Occasionally, with enough builds followed by changes to the form or
tabcontrol,
the .resx file associated with the form seems to get confused and the
indexes on the
tab pages change, in the code! To fix this, just open the Forms Designer
generated code
you aren't supposed to be editing and manually set the indexes of your tab
pages
to the order you desire them to appear.

I have never seen a difference between what's actually in the code and the
tabpage ordering
that results at runtime (as one would expect).

-Darren Shaffer

"Earl" <brik...@newsgroups.nospam> wrote in message
news:%23Ux25p3...@TK2MSFTNGP11.phx.gbl...

Daniel Moth

unread,
Nov 20, 2004, 10:49:33 PM11/20/04
to
It's a known bug
http://wiki.opennetcf.org/ow.asp?Articles%2FTabBug

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Earl" <brik...@newsgroups.nospam> wrote in message
news:%23Ux25p3...@TK2MSFTNGP11.phx.gbl...

Earl

unread,
Nov 20, 2004, 11:50:20 PM11/20/04
to
Excellent Darren. I had looked at the forms designer code and noted the
index numbers were not the same as I had assigned, but was definitely
hesitant to tinker with it, given all the dire warnings about changing that
code. Thanks.

"Darren Shaffer" <darren...@discussions.microsoft.com> wrote in message
news:%23wCbyu3...@TK2MSFTNGP14.phx.gbl...

Earl

unread,
Nov 20, 2004, 11:51:29 PM11/20/04
to
Thanks much Daniel! I spend half of my time making work what parts of CF and
SQLCE that do work and the other half figuring out how to get around "known
issues"....

"Daniel Moth" <dmo...@hotmail.com> wrote in message
news:uqbtd03z...@TK2MSFTNGP09.phx.gbl...

Rick

unread,
Nov 21, 2004, 7:11:12 PM11/21/04
to
Earl,

Reference your tabs by name as it makes life much easier ;-)

TabControl1.TabPages.IndexOf(TabPage1)

Rick

Earl

unread,
Nov 23, 2004, 10:09:51 PM11/23/04
to
That is a helpful thought, thanks Rick.

"Rick" <ri...@e-sword.net> wrote in message
news:OnwDIfC0...@TK2MSFTNGP15.phx.gbl...

0 new messages