Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Problems with Designer code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LightWarrior - 31 Aug 2006 12:44 GMT
Hello,

I created a form (form1) with an tabcontrol on it. This tabcontrol is
'protected'.
Now I create a new form (form2) and Inherit from form1. Now I can
modify the tabcontrol because of it is protected.

But now I get some problems. When I add some tabpages to the control
and then compile the program I got the error "Child is not a child of
control".

This is because in de Designer code of form2 the 'add-code' disappears
when I compile it. But the SetChildIndex-code is still there. So he
could not set the indexes of the pages because the pages are not childs
of the tabcontrol.

Now I add this code mannualy to the Designer:
"tabcontrol.tabpages.AddRange( ...)". When I compile it now, it will
work. But if I change something on form2 design-time. The error just
comes back.

Does anyone know what the problem could be?

GrtZ
Martijn S.
Stoitcho Goutsev (100) - 31 Aug 2006 14:41 GMT
Hi,

Maybe the best is to redesign your class. You cannot add manually any code
to the InitializeComponent beacuse the designer clears and regenerates this
method.

Signature

Stoitcho Goutsev (100)

> Hello,
>
[quoted text clipped - 21 lines]
> GrtZ
> Martijn S.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.