Re: Equivalent to VCL's DataModule



Clive Dixon wrote:

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.

Yes, I agree. Adding properties to the class is better.


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.

I see that now. I do not understand what the use of adding a UI control to a component class would be, sice I do not think the control would be shown at run-time in any way..
.



Relevant Pages


Loading