TControl – Explicit

TControl – Explicit

Can someone explain the purpose of  ExplicitTop, ExplicitLeft, ExplicitWidth and ExplicitHeight in TControl and descendants?

In particular – why are they in the .dfm?

24 thoughts on “TControl – Explicit


  1. from here: http://jedqc.blogspot.de/2006/02/d2006-what-on-earth-are-these-explicit.html


    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.


  2. same question with interesting answers and comments – http://stackoverflow.com/questions/2476690/delphi-why-does-explicitwidth-and-explicitheight-keep-appearing-in-dfm-files . And per documentation http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.Controls.TControl.ExplicitHeight – “ExplicitHeight is a read-only property used internally by Delphi. Use Height in applications to allow read and write access.”. So, only Embt can give you an answer


  3. I don’t think they are a problem even in a VCS.  The coordinates don’t change unless you do some serious editing of the form, so there won’t be a version bump.


    If you really hate them, then click the “Do not store the Explicit* properties into the DFM” checkbox in the DDevExtensions setup.


  4. Kevin McCoy They get added and removed every other time, so it’s not that the coordinates change, as much as the properties alternate being there and not being there… very annoying!


  5. To me these properties serve a need (guess what, they were “vocally” requested by Delphi users), that is getting a control back to its original position if you toggle its alignment, as explained also here.


    If they are added and removed “randomly” (alternative being there and not begin there), even if you don’t touch any of the related properties, that is it a bug (and maybe already reported) we should fix. If they are added according to the specs… I’m not sure I’d agree with the request of removing them completely.


  6. They should live in the TControl objects while you are editing them, but once you save – they should be gone.  IMO, there is no need to keep these between editing sessions.


  7. Lars Fosdal I disagree.  While I was not one of the “vocal” proponents of the feature, I kind of like the new behavior after stumbling across it.  It was a pain when you shut off alignment and your visual component went flying off into the stratosphere.  I had to manually tweak the Top and Left coordinate properties to get the component back on to my form. Now they sort of implode, but stay within the boundaries of your form – much easier/faster to work on complex forms.


  8. Lars Fosdal I think you are right in this. I also think the names are terrible, as they do nothing to indicate the purpose. DesignWidth, DesignHeight, etc., would have been more clear. 


  9. Asbjørn Heid do you (or someone) know if a specific bug is logged?


    Even if the names were not the best, changing them at this point would be dreadful, imho.


  10. Marco Cantù I’m pretty sure I saw a QC on it. It might even have been fixed, we’re still on XE3, probably for a good while. I’ll do some digging.

Leave a Reply