Delphi – 为什么ExplicitWidth和ExplicitHeight继续出现在.DFM文件中,它是什么?

前端之家收集整理的这篇文章主要介绍了Delphi – 为什么ExplicitWidth和ExplicitHeight继续出现在.DFM文件中,它是什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们注意到,在检查更新时,我们的.DFM文件添加了ExplicitWidth和ExplicitHeight属性,看起来没有什么特别的原因。

我的两个问题是,他们是什么,为什么他们被Delphi自动添加

下面是具有该属性的示例:

object Splitter2: TcxSplitter
    Left = 0
    Top = 292
    Width = 566
    Height = 8
    Cursor = crVSplit
    HotZoneClassName = 'TcxXPTaskBarStyle'
    AlignSplitter = salBottom
    Control = BottomPanel
    Color = clBtnFace
    ExplicitWidth = 8
end

解决方法

来自Google搜寻….

Original article can be found here.

The Explicit properties remember the
prevIoUs bounds of a control before
the Align or Anchor properties are
changed from their defaults.

The only time the Explicit properties
are not written is when the Align
property is set back to its default
value of alNone.

This is when the Explicit properties are actually used by the control to reset its bounds to what it was prevIoUsly.

原文链接:https://www.f2er.com/delphi/103653.html

猜你在找的Delphi相关文章