A couple things to know about form inheritance and the designer ...
1) The designer will instantiate your base form. This means the base form's
constructor will be called. (I think this is true... it's all very
compicated and I may not have it quite right...) If you use the derived form
in code (but do not instantiate the base form), then only the derived form's
constructor will be called. So possibly you have something that needs to be
initialized in order for the base form to be shown, but you're only
initializing it in the derived form?
2) There seems to be a weird restriction on the designer that if you have a
certain name that gets inherited, you can not name anything else in your
project by the same name, or by a name that differs only in casing... That
is, if you have a form with a derived control MyControl, you will have a
conflict (according to the designer) if a different form (not derived from
the same base) has something named myControl. There is no reason in C# these
should conflict, but the designer can't deal with it. (At least, mine
can't.)
3) This is something I've run across, not specifically about form
inheritance, and I see it as a bug, so maybe in some other version it's
fixed, but does seem to be a desiger issue...
If you have a property defined in an interface with only a "get", but define
a class that has a "get" and a "set" on that property, it will compile (and
I think should be fine, since interface only defines a subset of the
functions in a class.) However, if you have a component or control that
implents the property as read/write, the designer says you have conflicting
definitions (I guess it sees read only property as fundamentally different
from read/write property.)
Hope this helps,
Rachel
"JD" <JD@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
Hi
I had 2 forms inheriting from a base one. It all worked nicely to start
off
with. Don't know what I did next (did some code in the base form),
because
now the VS IDE doesn't want to open either of the child forms.
It complains about "ConnectionString property has not been initialized".
I'm tryig to build a 3 tier application so there is no DB connections on
mypresentation layer. But then, I just started C# so am probably missing
something obvious. The same error also displays when I try to create a new
form from the base.
Another thing to note is that the inherited forms work when I execute the
code. It is just in the IDE where I get the problem. I'll send code to
anyone who volunteers to help.
Thanks