|
-
December 1st, 2004, 04:45 PM
#1
Form Designer Bug
I have a project that has a form with a TabControl and lots of TabPages. There are too many tab pages to fit on the tab control, so it has a scroll arrow that allows you to scroll to the tab pages that do not fit.
There is a serious problem. The InitializeComponent() code generated by Form Designer keeps changing the order in which it adds the tab pages.
For example I start with
Code:
// InitializeCompnent
this.tabCtrl1.Controls.Add(tabPage1);
this.tabCtrl1.Controls.Add(tabPage2);
this.tabCtrl1.Controls.Add(tabPage3);
this.tabCtrl1.Controls.Add(tabPage4);
this.tabCtrl1.Controls.Add(tabPage5);
Then I add a button or something to one of the pages and I get
Code:
// InitializeCompnent
this.tabCtrl1.Controls.Add(tabPage3);
this.tabCtrl1.Controls.Add(tabPage1);
this.tabCtrl1.Controls.Add(tabPage2);
this.tabCtrl1.Controls.Add(tabPage5);
this.tabCtrl1.Controls.Add(tabPage4);
I have to keep changing it back to the correct order and everytime I edit the form in the designer, it rewrites InitializeComponent and puts the pages in the wrong order again. The ordering seems to be very random each time.
Is this a known bug in C#? If so, they better fix it in the next release of .NET.
Thanks in advance
-
December 2nd, 2004, 06:49 AM
#2
Re: Form Designer Bug
this is a bug and remains valid even in new version.
the solution is manully changing them in the code...
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|