DFM-Translator

Top  Previous  Next

DFM translation for Delphi2C# has been formally derived from the corresponding Delphi2Cpp feature. This feature is experimental and has not yet been fully implemented or tested. In particular, there is currently no C# translation of the VCL, so the generated form code cannot be expected to compile or run as a complete C# application. The feature will be completed and adapted to the specific requirements of C# if there is sufficient practical demand for it.

 

Delphi units that define VCL forms or frames are associated with form modules. These modules are stored in files with the .dfm extension. DFM files do not contain Object Pascal code; they describe user interfaces in a compact, declarative format.

 

Delphi2C# can parse DFM files and generate the C# code required to create their forms or frames at runtime. The DFM conversion option must be enabled for this purpose.

 

By default, DFM entries are converted into C# assignment statements. When Delphi loads a DFM file, however, some properties require additional processing. Delphi2C# can reproduce these effects by calling special conversion routines instead of assigning property values directly.

 

Several predefined routines are supplied, and additional routines can be defined when necessary. Their names are derived systematically from the relevant component types and properties. The routines should be declared and implemented in d2c_dfm.cs.

 

The code will be written into the constructor of the form or into the constructor of the frame. If the components are created dynamically at runtime the form file is not needed any more.

 

Use the DFM Conversion dialog to specify the types and properties for which Delphi2C# should generate calls to special assignment routines.

 

The generated code is written to the constructor of the form or frame. When all components are created dynamically at runtime, the original DFM file is no longer required.

 

 



This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content