Form file(Form files) Stores the binary information of the form.
Step 1. Create a New Delphi application in Delphi 【File | new | Application]. At this time, Delphi will create a form file (. DFM) and a unit file (. Pas) at the same time, such:
Step 2. OpenUnit1.pasForm unit file, you will see the following sentence:
{$ R *. DFM} {This sentence tells the compiler to connect the corresponding form file. The name is the same as the unit file, but the extension is. DFM}
Step 3. Let's take a look at what is in Form file. DFM? Right-click the form form1 designer and select 【View as text], Then the text of the form is displayed:
Have you noticed that 【Text DFM] Menu item. If checked, Delphi will save the form in text format.
Step 4. Check the content of the Form file. Is it very simple? It records some non-default attribute settings and some component attribute settings on the form.
Object form1: tform1 left = 376 {left and top coordinates of the form on the screen} Top = 207 width = 979 {width and height of the form} Height = 563 caption = 'form1' {Title of the form for form1} color = clbtnface {the form color is the button surface color} font. charset = default_charset {font attributes on the form, including character set, color, size, font name, style, etc.} font. color = clwindowtext font. height =-11 font. name = 'tahoma 'font. style = [] oldcreateorder = false pixelsperinch = 96 textheight = 13end
Tip: Be very careful when editing a Form file. If the operation fails, Delphi may not be able to open the Form file.