Re: Equivalent to VCL's DataModule




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.


.



Relevant Pages

  • Re: OOP in database programming - Newbie question
    ... I have no formal Delphi training, but I have written several database ... in them and all data is accessed through database controls. ... manipulating this data and then passing the data ... If I create a class representing the container ...
    (borland.public.delphi.non-technical)
  • Re: Component
    ... Yes I'm using Container to call dispose in all of the components of my ... Controls (I use a Control Composite (here I need to do other little change, ... don't implement IComponent (because this maybe will be not a class that I ...
    (microsoft.public.dotnet.framework.compactframework)
  • Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
    ... themselves use picture boxes for their drawing.(i.e no User Control ... in order for my controls to "blend in" nicely with their ... save, for each object, the pattern gradiant of its container. ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Contained Controls
    ... loop through only those contrls in that container. ... form VB supplies a Controls collection that contains the ... SetForeColor vbBlue, Groups, Groups ... Set grp = New Collection ...
    (microsoft.public.vb.general.discussion)
  • Re: Picture Box Tranparent, CreateDIBPatternBrushPT, PackedDIB
    ... > themselves use picture boxes for their drawing.(i.e no User Control ... in order for my controls to "blend in" nicely with their ... > save, for each object, the pattern gradiant of its container. ...
    (microsoft.public.vb.winapi.graphics)