1
votes

I have a codebase that I'm working on that is written to work in both Delphi 5 and Delphi 10.2, until we get everything converted to D10.

Whenever I open a DFM file in 10.2 and save it, it automatically adds a DesignSize property to the TForm. This property doesn't exist in D5, so I get errors every time I open the same DFM in D5.

Is there any way to prevent D10 from auto-updating the DFM? Or is this not possible?

1
What about making the DFM read-only? The DesignSize property is only written, when you have some child component set to Align = alNone and Anchors <> [akLeft, akTop]. Perhaps you can avoid this combination.Uwe Raabe
@Uwe Thats a pretty good idea. The only issue with that I can think of is having to make it writable when making changes to dfm, which isn't done so often.D.D
@UweRaabe: That combination is difficult to avoid! I use it all the time to make dialog boxes behave well when resized.Andreas Rejbrand

1 Answers

2
votes

You could clear them out using a utility when needed. The JVCL includes a utility called DFM Cleaner that does this. In ends up in $(JVCL)\DevTools after JVCL is installed.

DFMCleaner is a tool to remove unsupported properties from DFMs. If you save a dfm file in one version of Delphi and want to use it in an earlier version, chances are there are some unsupported properties in it, generating an error when the form is opened in Delphi. What's even worse, if the dfm is part of a design-time package, Delphi will install the package without errors but when you try to access the form at design-time (f ex if the form is used by a property editor), Delphi generates an AV instead.