0

我购买了 TMS 组件包,并希望隐藏一些组件属性,使其不显示在对象检查器中。

UnlistPublishedProperty用来隐藏它们。

它大部分时间都有效。但由于某种原因,例如AnchorsStyleSettings仍然显示。

我这样称呼它:

  UnlistPublishedProperty(TAdvEdit, 'StyleElements');

奇怪的是它适用于 90% 的属性,我不知道为什么它不会对对象检查器隐藏其他属性。

我可以编辑源代码并注释掉它从 TCustomEdit 发布的行,但我想知道为什么该方法UnlistPublishedProperty不起作用。

谢谢!

4

2 回答 2

1

您尝试删除的属性是从更高的祖先类继承的。如果您希望使用UnlistPublishedProperty删除这些特定属性,则必须将它们从祖先中删除。但是,这将适用于所有控件,而不仅仅是您正在处理的控件。

于 2015-11-25T19:32:43.327 回答
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.

于 2015-11-25T22:56:36.650 回答