Jeremy
Wed Jul 14 00:28:15 CDT 2004
"Pedro" <pnmm@portugalmail.pt> wrote in message
news:9f72c57b.0407131012.37bb5a78@posting.google.com...
> pnmm@portugalmail.pt (Pedro) wrote in message
news:<9f72c57b.0407130241.6adebeb0@posting.google.com>...
> > "David Williams" <DavidWilliams@discussions.microsoft.com> wrote in
message news:<99A82562-3808-4F23-8005-EFE411FA2F67@microsoft.com>...
> > > What I tend to do when I run into issues like this (which is as
Herfried stated, you can not design a form that inherits from a MustInherit
class,) is to do something like:
> > >
> > > #If DEBUG Then
> > > Public Class fmsdvPrincipal
> > > #Else
> > > Public MustInherit frmsdvPrincipal
> > > #End If
> > >
> > > However, there MIGHT be a problem with that in this case. If the
class has any routines that you marked as MustOverride, you will have to
change them, possiblly by wrapping in an #If as above, to Overridable and
give no implementation details.
> > >
> > > HTH
> > > --
> > > David Williams, VB.NET MVP
> > >
> > >
> > > "Herfried K. Wagner [MVP]" wrote:
> > >
> > > > * pnmm@portugalmail.pt (Pedro) scripsit:
> > > > > I have my base form, declared as musthinherit;
> > > > >
> > > > > Public MustInherit Class frmsdvPrincipal
> > > > >
> > > > > ...
> > > > >
> > > > > and my child form, declared as inherited;
> > > > >
> > > > > Public Class frmsdvEtiquetas
> > > > > Inherits SDV.UL.Principal.frmsdvPrincipal
> > > > >
> > > > > ...
> > > > >
> > > > > In run-time, frmsdvEtiquetas runs perfect, but in design time,
this
> > > > > error occurs;
> > > > >
> > > > > "The designer must create an instance of type
> > > > > 'SDV.UL.Principal.frmsdvPrincipal' but it cannot because the type
is
> > > > > declared as abstract"
> > > >
> > > > You cannot edit a form that inherits from a mustinherit form in the
> > > > windows forms designer because the designer must be able to
instantiate
> > > > the base class.
> > > >
> > > > --
> > > > Herfried K. Wagner [MVP]
> > > > <URL:
http://dotnet.mvps.org/>
> > > >
> >
> >
> > Hi!
> >
> > I think i figure a way to control this inheritance issue in design/run
> > time, with your advances, but this design issue in vb.net is very
> > anoying! Now, i can't see my child form controls in run-time. They
> > appear normally in design but not in run-time! Why?
> >
> > Any ideas?
> >
> > Thanks in advance!
>
> Sorry i wasn't very specific in the latest post! My child form
> inherits anything from my base form. What i want is to add some
> controls (not inherited) to my child form, but they only appear in
> design! Why is that?
>
> Help needed!
> > Thanks in advance!
Are you adding the controls to a panel or other container? If so, you need
to make sure the container control's modifier is not set to Private in the
base form (preferably, it would be set to Protected). The behavior you
describe happens when the modifier is set to Private.