作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
此代码可以与 VCL 表单应用程序中的 IDE 生成的表单配合使用:
Self.ParentBackground := True;
但是为什么呢?后代(TForm
、TCustomForm
、TScrollingWinControl
)均未发布 TWinControl< 的 protected
。单元顶部的表单(即“TForm1”)的类型声明也没有。果然不出所料,这个ParentBackground
属性。/
TForm(Self).ParentBackground := True;
无法编译(“无法访问 protected 符号 TWinControl.ParentBackground”)。与运行时创建的任何表单相同。
注意:问题不是关于如何设置属性(顺便说一句,还有其他属性,例如“Bevel[xxx]”),我想知道这是如何工作的。
最佳答案
Self.ParentBackground := True;
编译是因为类可以访问它自己的 protected 成员。
关于delphi - ParentBackground 如何在 IDE 生成的表单上工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12079805/
我是一名优秀的程序员,十分优秀!