Saturday, 19 August 2017

Delphi - Why does ExplicitWidth and ExplicitHeight keep appearing in .DFM files and what is it?




We've noticed that when checking in updates, our .DFM files have added ExplicitWidth and ExplicitHeight properties - but we don't know why.



My questions are:




  • What are these properties for?

  • Why are they automatically added by Delphi?



Below is an example showing the added ExplicitWidth property:




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

Color = clBtnFace
ExplicitWidth = 8
end

Answer



From Googling....



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.



No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...