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 / December 2004

Tip: Looking for answers? Try searching our database.

Form Inheritance and missing controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cduden - 02 Dec 2004 18:21 GMT
Ok, I know this is going to sound odd but this is what I am seeing.  I have
a form inheritance chain that looks like this:

baseform  --> childform -- > two seperate endforms (endform1, endform2)

When I open the designer for childform I only see the controls that were
laid out in baseform.  When I open either endforms I only see what was
defined in baseform + childform.  Attaching to the vs process and attempting
to debug into InitializeComponent when opening the designer for endform1, it
never hits the breakpoints in endform1 even in the constructor.  It does
however hit the breakpoints in childform's constructor.  So essentially I
now have a bunch of forms that I cannot edit in the designer.  Does anyone
have any clue as to what is going on?

Thanks,
CMD
Tom Krueger [MSFT] - 03 Dec 2004 00:24 GMT
Hmm,

I just tested this scenario and it works for me.  I created 3 forms,
FormTop, FormMiddle, FormBottom.  On each form I added and labeled a button
appropriately (Top, Middle, Bottom).  Then added the appropriate inheritance
as follows:

public class FormMiddle : FormTop {
public class FormBottom : FormMiddle {

Compiled the project and when I open FormBottom all three buttons show up.

My initial thought was that you didn't have the call to
InitializeComponent() in the no parameter constructor, however, you say that
you get the controls of the parent forms so that is confusing.

I would try to create a sample as I did and look for the differences between
your two projects.  If you find the answer, please post it so we all can
learn.  If you have more information, post that as well and I will try to
assist further.

Take care,

Tom Krueger

Smart Client DevCenter - http://msdn.microsoft.com/smartclient/
Mobile DevCenter - http://msdn.microsoft.com/mobility

This posting is provided "as is" with no warranties and confers no rights.

> Ok, I know this is going to sound odd but this is what I am seeing.  I
> have a form inheritance chain that looks like this:
[quoted text clipped - 12 lines]
> Thanks,
> CMD
cduden - 03 Dec 2004 16:40 GMT
Hello Tom,

Thanks for the quick reply.  I should say that I did the same thing you did
in creating a simple test harness.  The other thing is this all worked fine
at one point since that is how these forms (roughly 26000 lines of code
combined) were created.  What has happened since then I do not know nor
understand.  I do have calls to InitializeComponent in each of the default
constructors but the strange thing is that when debugging the designer in
Visual studio with another instance of visual studio it never hits the
default constructor for the form that I am opening but rather only hits the
default constructor for the form that it inherits from (bizarre) which is
why just it's controls show up I suppose.  I keep thinking that this is
going to be one of those "duh" solutions but I have been looking at it for 3
days now without coming to any resolution.  I'm not even sure of where to
proceed from here.  I can start backing out changes in VSS but this is a
production system that runs fine but needed some simple changes made and I
would like to avoid doing that if possible -- not to mention that allot of
changes have been made to these forms since the last time the designers were
opened and we discovered this anomaly  Any thoughts as to what might be
going on?  I will take a look at the test harness I built and compare what
is there from a structure perspective to this form-chain and see what I can
figure out.

Thanks,
CMD

> Hmm,
>
[quoted text clipped - 42 lines]
>> Thanks,
>> CMD
Tom Krueger [MSFT] - 03 Dec 2004 23:17 GMT
That's funny.  I was thinking this sounded like one of those (as you say)
"duh" solutions.  I have posted this question on an internal dist list so
hopefully someone will have an idea.  However, this could end up being one
of those "duh" problems and there won't be any answer.  I am open to taking
a look at your code if it is easy to setup and run, but that is up to you.
If you are interested contact me through my blog
http://weblogs.asp.net/tom_krueger/contact.aspx (to get my actual email
address).

Signature

Tom Krueger

Smart Client DevCenter - http://msdn.microsoft.com/smartclient/
Mobile DevCenter - http://msdn.microsoft.com/mobility

This posting is provided "as is" with no warranties and confers no rights.

> Hello Tom,
>
[quoted text clipped - 70 lines]
>>> Thanks,
>>> CMD
joeycalisay - 06 Dec 2004 01:34 GMT
form constructors are never executed at design time, rather its base's
default constructor + its InitializeComponent

http://www.urbanpotato.net/Default.aspx/document/1772

> That's funny.  I was thinking this sounded like one of those (as you say)
> "duh" solutions.  I have posted this question on an internal dist list so
[quoted text clipped - 79 lines]
> >>> Thanks,
> >>> CMD

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.