DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: hxh57738897
今日帖子: 28
在线用户: 15
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2023/3/15 23:39:31
标题:
VCL 的 Frame 的问题 浏览:1079
加入我的收藏
楼主: 我在一个工程里面做了很多个 Frame,在某个地方,在设计期,我从控件面板拖一个 Frame 过来,然后 Delphi 就出来一个下拉的表,里面显示我在这个工程里面做的 Frame,让我选择一个,然后我选的 Frame 就出现在界面上了。

我的问题是,拖一个 Frame 到界面上时,Delphi IDE 显示的那个有很多 Frame 的下拉表,并没用包括我在这个工程里面做的所有 Frame,有一些没用出现在这个下拉表里面,我想选也没得选。

请问这种情况是什么原因导致?
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/3/16 1:11:30
1楼: How many frames are you talking about, exactly? 20, 50, 100, 200, 500, etc...

Are any of these frames embedded in other frames or forms, datasources, etc...? 
--- Here, perhaps it would be necessary to have the "ancestor" open in the IDE, even if it is not the object currently being edited!

Indeed, the use of "frames" (objects embedded in Delphi, has some problems when we talk about many objects, or when objects are embedded in other objects)... 

The abusive use of "Frames", (I think) that can bring a lot of problems when you need to revisit and edit them again... 

In the past (on older IDEs), it was common for me to have problems with frames within frames!!! You always needed to know which frame was the ancestor of the next frame to open in the IDE.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 chintatlim (chin) ★☆☆☆☆ -
普通会员
2023/3/16 11:39:09
2楼: 以下信息是ChatGPT提供:

根据您提供的信息,有以下可能导致该问题:

缺少使用的单元:如果您在工程中使用了一些单元,但是这些单元没有添加到当前正在使用的单元列表中,那么 Delphi 就可能无法识别这些单元中的 Frame。在这种情况下,您需要在当前单元中添加所需的单元。

未正确命名 Frame:如果您在工程中使用了一些 Frame,但是它们没有被正确地命名,那么 Delphi 可能无法在下拉列表中正确地显示它们。在这种情况下,您需要在 Object Inspector 中选择相应的 Frame,然后在 Name 属性中为它们指定一个唯一的名称。

未保存 Frame 单元:如果您在工程中使用了一些 Frame,但是它们所在的单元还没有被保存,那么 Delphi 就无法在下拉列表中正确地显示它们。在这种情况下,您需要确保您保存了包含 Frame 的单元。

框架类没有正确注册:如果您使用的 Frame 类没有正确注册,那么 Delphi 可能无法在下拉列表中正确地显示它们。在这种情况下,您需要在 Frame 类的单元中使用 RegisterClass 函数将其注册到 Delphi 中。

以上是一些可能导致该问题的原因。如果您仍然无法解决问题,请提供更多详细信息以帮助确定问题的根本原因。
----------------------------------------------
-
作者:
男 bluestorm8 (bluestorm) ▲▲△△△ -
普通会员
2023/3/16 12:30:48
3楼: 我觉得在设计期直接在界面上拖放frame不太好,我认为在程序运行期才把frame附加上去会比较好,如下面的代码所示:

frame := TFrame1.Create(TabSheet1);
frame.Parent := TabSheet1;
frame.Align := alClient;

【Delphi Frame 使用示范】
https://blog.csdn.net/BlueStorm/article/details/129091533
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2023/3/16 22:38:51
4楼: to emailx45: in this project, there are 20 frames. The frame that should be showing in the list box is not inherited from other frame, so there is not about "have the "ancestor" open".

to 2 楼:缺单元,未正确命名,未保存,这三条都不是。正确注册这条,Frame 无需注册类别,在 IDE 里面应该就能看到。至少那些能够显示到 List box 里面的,和不能显示的,都一样是通过 IDE 创建的。

to 3 楼:如果必须要在运行期创建的,我一般会在运行期创建。但如果拖拉摆放就能搞定的,我还是会拖拉摆放。毕竟在 Delphi 里面,拖拉摆放是一个比较好用的功能。
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/3/17 4:06:41
5楼: hi @pcplayer

it will be this that you dont see in your IDE? (if I understood right...)

the listbox from IDE when try use a Frame in your project?

I created 50 frames and all appears in Listbox from IDE when try use a frame... as you see here

or it will be other thing?
此帖子包含附件:
GIF 图像
大小:793.3K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2023/3/18 21:14:09
6楼: 除非你是用frame做组合型组件,否则应该使用动态创建frame的办法。
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2023/3/19 15:52:36
7楼: Hi emaix45, yes, but in my project, it not show all of the frames in the IDE list box.
----------------------------------------------
-
作者:
男 thinknet (thinknet) ★☆☆☆☆ -
盒子活跃会员
2023/3/20 23:52:39
8楼: 这个问题经常出现,虽然我不知道是什么原因造成的,但个人认为是IDE的BUG,一般我是先将丢失的Frame单元从Project中移除,然后再添加进来,就可以正常使用了。这个方法有些繁琐,总算勉强能用。
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2023/3/21 0:12:32
9楼: 多谢8楼,你的办法我试试
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行85.9375毫秒 RSS