views:

130

answers:

2

I have created a new VCL component based on an existing VCL component. What I want to do now is set the Password and Username properties from an ini file instead of the property inspector.

Robert Dunn Link

I read on the delphi forum above you cannot unpublish a property and that the only workaround is to redeclare the property as read-only. I tried this but it all it does is make the property read only and grayed out in the object inspector. While this could work I would prefer if the property wasn't visible at all.

__property System::UnicodeString Password = {read=FPassword};

Thanks in advance for any help or links to c++ VCL component writing tutorials. I am using CB2010

A: 

The language as defined will not allow you to hide published properties.

I would make use of aggregation instead of inheritance i.e. Create a new VCL component that delegates its methods to the existing component, you then have full control over what properties to publish.

Hannes de Jager
+2  A: 

Look up DesignIntf.UnlistPublishedProperty. See this tread.

JRL
woohoo, that works :) thank you!
Gary Benade