gpt4 book ai didi

delphi - ParentBackground 如何在 IDE 生成的表单上工作?

转载 作者:行者123 更新时间:2023-12-03 15:19:17 30 4
gpt4 key购买 nike

此代码可以与 VCL 表单应用程序中的 IDE 生成的表单配合使用:

Self.ParentBackground := True;


但是为什么呢?后代(TFormTCustomFormTScrollingWinControl)均未发布 TWinControl< 的 protected ParentBackground 属性。/。单元顶部的表单(即“TForm1”)的类型声明也没有。果然不出所料,这个

TForm(Self).ParentBackground := True;

无法编译(“无法访问 protected 符号 TWinControl.ParentBackground”)。与运行时创建的任何表单相同。


注意:问题不是关于如何设置属性(顺便说一句,还有其他属性,例如“Bevel[xxx]”),我想知道这是如何工作的。

最佳答案

Self.ParentBackground := True;

编译是因为类可以访问它自己的 protected 成员。

关于delphi - ParentBackground 如何在 IDE 生成的表单上工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12079805/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com