Re: Equivalent to VCL's DataModule
- From: Edward Diener <eddielee_no_spam_here@xxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 19:24:33 -0500
Clive Dixon wrote:
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).
Thanks for the explanation.
Does the IDE know to look for a private variable of type System.ComponentModel.Container in a CLR object in order to have that object act as a container for other objects at design time ? If not, what is the criteria by which an object at design time can act as a visual container of other objects ?
.
- Follow-Ups:
- Re: Equivalent to VCL's DataModule
- From: Clive Dixon
- 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
- Re: Equivalent to VCL's DataModule
- From: Clive Dixon
- Equivalent to VCL's DataModule
- Prev by Date: asynchronous callback problem
- Next by Date: Re: Equivalent to VCL's DataModule
- Previous by thread: Re: Equivalent to VCL's DataModule
- Next by thread: Re: Equivalent to VCL's DataModule
- Index(es):
Relevant Pages
|