如何向组件添加反映对象检查器的属性
在Delphi 7中,当向对象添加属性时,如何在对象检查器中看到该属性?
in Delphi 7 , when adding a propery to an object, how is it possible to see that property in the object inspector?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使该属性
发布
。例如,通常,当属性更改时,您需要重新绘制控件(或进行一些其他处理)。然后你可以做
Make the property
published
. For instance,Often, you need to repaint the control (or do some other processing) when a property is changed. Then you can do
将该属性添加到已发布部分,它将使其显示在对象检查器上,如下所示:
Add that property to the published section, it will make it appear on the Object Inspector, like this:
来自文档:
From the docs:
不要忘记该组件需要在 Delphi 中注册(最好在设计时包中),否则您将在对象检查器中根本看不到任何内容!
我的意思是...我可以创建一个名为 TMyPanel 的新 TPanel 后代,并向其添加一个新的 Published 属性:
但是如果您没有使用 RegisterComponent 注册新类,则该属性不会显示在对象检查器中:
只是为了完全的 :-)
Don't forget that the Component needs to get registered within Delphi (preferable in a Design Time Package) or you you won't see anything in the Object Inspector at all !!!
I mean ... I can create a new TPanel descendant called TMyPanel and add a new Published property to it :
but that property won't get displayed in the Object Inspector if you havn't registered the new class using RegisterComponent :
Just to be complete :-)