Form Inheritance and missing controls

C

cduden

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
 
T

Tom Krueger [MSFT]

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.
 
C

cduden

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
 
T

Tom Krueger [MSFT]

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).

--
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.
 

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