Hi all,
Anyone can tell me if the derived forms need to call the constructor of the
ancestor Form ?
Also it's needed to call InitializeComponent() from Ancestor form or not ?

Sample:
public Class AncestorForm: System.Windows.Forms.Form
{
Public AncestorForm() //:base() needed or not ?
{
InitializeComponent();
}
}

public Class DerivedForm: AncestorForm
{
Public DerivedForm(): base() //:base() needed of not ?
{
InitializeComponent();
}
}

Tanks for your help

Re: Inherited Forms by Demon

Demon
Wed Jun 15 04:47:18 CDT 2005

Hi Olivier,

The default constructor of the parent object will automatically be called,
however if the parent has a parameterised constructor that you want called
when the derived object is created you will need to explicitly call it.

Regards

James Thresher

"Olivier Sauterel" <sauterel@ioware.ch> wrote in message
news:uJBFhuYcFHA.3712@TK2MSFTNGP09.phx.gbl...
> Hi all,
> Anyone can tell me if the derived forms need to call the constructor of
> the ancestor Form ?
> Also it's needed to call InitializeComponent() from Ancestor form or not ?
>
> Sample:
> public Class AncestorForm: System.Windows.Forms.Form
> {
> Public AncestorForm() //:base() needed or not ?
> {
> InitializeComponent();
> }
> }
>
> public Class DerivedForm: AncestorForm
> {
> Public DerivedForm(): base() //:base() needed of not ?
> {
> InitializeComponent();
> }
> }
>
> Tanks for your help
>