0

I bought the TMS Component pack and want to hide some component properties from displaying in the object inspector.

I am using UnlistPublishedProperty to hide them.

It works most of the time. But for some reason e.g. Anchors or StyleSettings are still displayed.

I am calling it like this:

  UnlistPublishedProperty(TAdvEdit, 'StyleElements');

The weird thing is that it works on 90% of properties and i can't figure out why it will not hide the other properties from the object inspector.

I could edit the source and comment out the line where it gets published from TCustomEdit but i am wondering why the method with UnlistPublishedProperty isn't working.

Thanks!

Tommy
  • 596
  • 6
  • 30
  • 1
    See also [How do you remove a property from a descendent component](http://stackoverflow.com/q/15961579/757830). – NGLN Nov 25 '15 at 22:57

2 Answers2

1

The properties you are trying to remove are inherited from a higher ancestor class. If you wish to use UnlistPublishedProperty to remove these particular properties, you'll have to remove them from the ancestor. However, that would apply to all controls, not just the one you're working on.

Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
  • Not necessarily. You could use an interceptor class instead of directly modifying the ancestor class. This way your modification presented in interceptor class would only affect the units in which your interceptor class is used. In fact this is the perfect scenario for using of interceptor classes. – SilverWarior Nov 26 '15 at 00:18
  • @SilverWarior True, I was aiming at the behavior of how `UnlistPublishedProperty` works. – Jerry Dodge Nov 26 '15 at 00:19
0

In addition to Jerry's answer; there is a solution for deleting properties from sub-components. The third part of my answer here demonstrates how to filter out properties of a sub-component of a custom component by registering a component PropertyEditor and overriding GetProperties to filter specific property names.

Community
  • 1
  • 1
NGLN
  • 43,011
  • 8
  • 105
  • 200