Inherit Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all expert,

I need to create a baseform with MustOverride function, but i found that
once I had the parent form with mustoverride function, the child form are
not displayable in design view.

What had I had wrong?

Thanks alot.
 
If you have a mustoverride function then the form becomes Mustinherit.

MustInherit forms cannot be instantiated but, the designer needs to
instantiate it to display the derived form.

Thus the problem.

hth,
Alan.
 
Hi alan,
sorry that, I still do not understand how I can make my child form
display able at design view...
can u briefly describe how? thanks a lot.
 
He's saying that you can't.

_________________________________________
The Grim Reaper
 
I need to create a baseform with MustOverride function,

Actually, you don't, because currently, you can't.
i found that once I had the parent form with mustoverride function,
the child form are not displayable in design view.

because the Form's designer really *does* need to instantiate
your "abstract" form before it can use it.
(Don't know if this changes with VS'2005).

Remove the "MustOverride" keyword and add a very simple, if
annoying, implementation, something like

Protected Overridable Sub Beep()
If Not System.Diagnostics.Debugger.IsAttached Then
Throw New NotImplementedException()
End If
End Sub

People will get the idea *very* quickly ... ;-)

HTH,
Phill W.
 

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

Back
Top