PC Review


Reply
Thread Tools Rate Thread

Another tabcontrol odditiy

 
 
Earl
Guest
Posts: n/a
 
      21st Nov 2004
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?


 
Reply With Quote
 
 
 
 
Darren Shaffer
Guest
Posts: n/a
 
      21st Nov 2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      21st Nov 2004
It's a known bug
http://wiki.opennetcf.org/ow.asp?Articles%2FTabBug

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


"Earl" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
Earl
Guest
Posts: n/a
 
      21st Nov 2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>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?
>>

>
>



 
Reply With Quote
 
Earl
Guest
Posts: n/a
 
      21st Nov 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> It's a known bug
> http://wiki.opennetcf.org/ow.asp?Articles%2FTabBug
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "Earl" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>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?
>>

>
>



 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      22nd Nov 2004
Earl,

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

TabControl1.TabPages.IndexOf(TabPage1)

Rick



 
Reply With Quote
 
Earl
Guest
Posts: n/a
 
      24th Nov 2004
That is a helpful thought, thanks Rick.

"Rick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Earl,
>
> Reference your tabs by name as it makes life much easier ;-)
>
> TabControl1.TabPages.IndexOf(TabPage1)
>
> Rick
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar Sharing Odditiy =?Utf-8?B?RFJhY2UxMTEx?= Microsoft Outlook Calendar 1 27th Apr 2006 02:41 PM
Response.Redirect Odditiy Johnny Fugazzi Microsoft ASP .NET 10 20th May 2005 08:39 AM
TabControl how do get close tab [x] on tabcontrol ? MumboJumbo Microsoft C# .NET 3 22nd Apr 2005 02:25 PM
Proper Case Odditiy NoSpam@aol.com Microsoft Excel Programming 3 14th Feb 2005 10:55 AM
TabControl scorpion53061 Microsoft Dot NET Framework Forms 2 7th Dec 2003 04:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:32 AM.