TFrame作为组件,IDE在首次使用时将对象更改为内联 [英] TFrame as Component, IDE changes object to inline on first use

查看:50
本文介绍了TFrame作为组件,IDE在首次使用时将对象更改为内联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有可视控件和数据库控件的Tframe单元。我使用小树枝方法将框架注册为组件。 TFrame具有一些已发布的布尔属性。

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.

一切正常,除了我注意到如果启动IDE并打开使用该组件的项目,IDE会抱怨未知的已发布属性。如果人们看一下DFM,Delphi会将帧的定义从对象...更改为内联...。如果我只是关闭项目而不保存,然后重新打开,那么一切都很好。

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.

推荐答案

这里的事情是注册TFrame确实有效,但是发布属性几乎总是无效。我说几乎总是,因为我过去曾遇到过此类问题(据我所记得,Delphi XE2),并且似乎存在一个隐藏在某个地方的设计器错误。调试该问题当时没有任何结果。

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.

我建议您只是将已发布的属性移到public并直接在源代码中设置这些属性。这是一种解决方法,但可以。

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.

这篇关于TFrame作为组件,IDE在首次使用时将对象更改为内联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆