InitializeComponent changes TabPage order without warning

G

Guest

Tab pages, which I have added to forms in design view, are occassionally
reordered without warning. Other than hard-coding the tab order by clearing
then readding these same tab pages outside InitializeComponent, is there
another way to prevent such reodering?

Steve
 
G

Guest

Tim,

Thank you. I checked the link, and that is indeed what I am experiencing.
Hopefully, MS will fix this someday, since I have a lot of forms with tab
pages, as well as tab pages within tabs, and the code to undo, then redo what
the designer is supposed to do once is less than elegant. If you happen to
know of a link where MS has acknowledged the issue, I would appreciate the
same, since I would then be able to track progress of a resolution.

Regards,
Steve
 
T

Tim Wilson

I thought there was a KB article on this but I did a quick search and turned
up nothing. I, too, am hoping that this issue is resolved with a future
service pack so that devs that continue to use VS.Net 2003 do not continue
to experience this problem. I have heard that this issue is resolved with VS
2005.
 
G

Guest

I found this bug report and response to it by a person on the VS2005 product
team. From the response, I gather they have not fixed the bug, nor do they
intend to do so in the future, since they do not admit it IS a bug.

http://lab.msdn.microsoft.com/produ...edbackid=4342046f-1b2f-4645-b183-f04bbc592c60

The text of their reply is as follows:
<quote>
Resolved as Not Reproduced by Microsoft on 2005-05-20 at 03:08:05

Thanks for reporting this issue, for some reason I am not able to reproduce
the problem with the steps provided. If you have any additional information
and/or project files that could help me repro it would be much appreciated.

Thank you,
Vivek, VS2005 Product Team
<end quote>

Notice the key word "Resolved". If it had not been for that one word, I
would have some hope.

I'll just continue to work around the problem by clearing then re-adding the
individual tab pages at run time. It isn't elegant, but when tools do not
support elegant programming, what can one do?

Steve
 
T

Tim Wilson

Huh. I was under the impression that it was fixed for 2005. It doesn't
surprise me that whoever replied to that message could not repro the bug as
it appears to happen at random. I've seen this issue, as well as many
others, but I've never seen a reliable repro for it. I guess the only thing
to do now is to hope that the bug report information is wrong and that this
is fixed for 2005 RTM.
 
M

Mick Doherty

Whilst I am not sure exactly how this happens during the normal design time
process, I am able to reproduce the undesired behaviour by taking steps that
I would not normally take.

Start a new project.
Add a tab Control with 5 tabpages.
Select tabpage 5 and BringToFront.
Select tabpage 3 and BringToFront.
Build.

Close and reopen the form editor.

The tabpages should now be displayed in the order 3,5,1,2,4

Reorder the tabpages in the collection editor using the arrow buttons.
Tabpages 4 and 5 will always be the wrong way round after a rebuild, but
will appear to be correct whilst the form designer is not closed and
reopened.

By selecting the tabpages in the form designer and reordering them via
BringToFront, the correct order can be reset.
This method of reordering is outlined on my TabControls page:
http://dotnetrix.co.uk/tabcontrols.html

It's pretty simple to emulate the error, but I have no Idea why it happens
during the normal course of Design.
I may be totally off, but I suspect that there may be some unnecessary
zOrdering whilst maintaining the hidden Dock property of the tabpage. The
reason that I suspect this, is that I often change zOrder of Fill Docked
panels to get them Docked correctly , but of course, since only one tabpage
can be Visible at any one time, it is not necessary to change the zOrder and
so this may not be the case at all.
 

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