Re: Equivalent to VCL's DataModule
- From: "Clive Dixon" <clived.noluncheonmeat@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 10:47:53 +0100
Can any component derived class serve as a container for other
components if it implements System.ComponentModel.Component's constructor
which takes a System.ComponentModel.IContainer as a parameter ?
Further to my previous answer, I think I might be misunderstanding what you
are getting at.
If I create a component class in VS, it will generated with:
1) a constructor taking IContainer and calling IContainer.Add(IComponent),
so that if you for example drag drop your component onto a form (which is
generated by VS containing a Container object), VS ensures that your
component will be added to the form's Container object.
2) a private variable of type Container which may be used as the container
for other components you drag drop onto your component. Likewise, VS will
add that other component to your component's container only if that other
component has a constructor taking IContainer (and that constructor would
have to call IContainer.Add(IComponent) to work correctly).
.
- Follow-Ups:
- Re: Equivalent to VCL's DataModule
- From: Edward Diener
- Re: Equivalent to VCL's DataModule
- References:
- Equivalent to VCL's DataModule
- From: Edward Diener
- Re: Equivalent to VCL's DataModule
- From: Clive Dixon
- Re: Equivalent to VCL's DataModule
- From: Edward Diener
- Re: Equivalent to VCL's DataModule
- From: Stephany Young
- Re: Equivalent to VCL's DataModule
- From: Edward Diener
- Re: Equivalent to VCL's DataModule
- From: Clive Dixon
- Equivalent to VCL's DataModule
- Prev by Date: initialising strings
- Next by Date: Re: NUnit says: An attempt was made to load a program with an incorrect format
- Previous by thread: Re: Equivalent to VCL's DataModule
- Next by thread: Re: Equivalent to VCL's DataModule
- Index(es):
Relevant Pages
|