Re: Equivalent to VCL's DataModule
- From: "Clive Dixon" <clived.noluncheonmeat@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 10:23:34 +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 ?
If the component is to be a container in itself, I would have thought it
would have to either implement IContainer itself or have a Container object
to be used as a container for the second level of components, rather than
re-use the top-level container.
Unlike VCL's DataModule all of the contained components are declared
private in the class, which means that they are not accessible outside of
the class. What waa the reason for that ?
Usual design guidelines. Make data private and add public properties to
access the data. You can add your own public properties to the class to
access whatever subset of data you need to access, or you can change the
accessibility of components in the properties panel ("Modifiers" property),
but I would personally do the former.
I noticed that my component will only visually accept non-GUI components
to be embedded within it in the IDE. That is what I want, but I was
wondering what controls that, especially as the
System.ComponentModel.IContainer accepts any IComponent interface ?
Not sure what you mean. I can add a UI control to a component class.
.
- Follow-Ups:
- Re: Equivalent to VCL's DataModule
- From: Edward Diener
- 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
- Equivalent to VCL's DataModule
- Prev by Date: Re: need help on regex
- Next by Date: initialising strings
- Previous by thread: Re: Equivalent to VCL's DataModule
- Next by thread: Re: Equivalent to VCL's DataModule
- Index(es):
Relevant Pages
|