TFrame as Component, IDE changes object to inline on first use

ⅰ亾dé卋堺 提交于 2020-01-04 05:22:33

问题


I have created a Tframe unit with visual and DB controls. I registered the frame as a component using the sprig approach. The TFrame has a few published boolean properties.

Everything works OK, except I have noticed that if I start the IDE and open a project that uses that component, the IDE complains about the "unknown" published properties. And if one looks at the DFM, Delphi has changed the definition for the frame within the form it is embedded in from "object ..." to "inline ...". If I just close the project, without saving, and re-open it, all is good.

It only happens on the first project open.

Any suggestions would be appreciated.


回答1:


The thing here is that registering a TFrame does work, but publishing properties almost always does not. I say "almost always" as i had this kind of issue in the past (Delphi XE2 as far as i remember) and there seems to be a bug in the designer deeply hidden somewhere. Debugging this issue gave me no results back then.

I suggest you simply move the published properties to public and set these properties in source code directly. This is a workaround but it works.



来源:https://stackoverflow.com/questions/33683142/tframe-as-component-ide-changes-object-to-inline-on-first-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!