Jump to content
Press_ALT_F4

how to load a form from a dfm-file

Recommended Posts

Hi,

 

sry for my english.

i create a form with the form-editor (3.39) and save it as dfm.

now i will write a script and load the saved form with the script.

how can i do this?

 

and a other question, its there everywhere german tutorial or something?

i want learn more about database and fromfunctions.

 

hope for answer :)

bye

Link to comment
Share on other sites

You can't load a form from a DMF file. You have to convert it into script code. The form designer can do this for you.

 

There are no German tutorials here, but maybe there are on German forums where SCAR is also used.

 

The database functions are documented here. They all come with examples on how to use them. You will need to know how to use SQLite3 though.

Link to comment
Share on other sites

Hi,

thanks for answer :)

i have opened the dfm with the scar, it shows code like:

 

object Form1_1: TForm
 Left = 653
 Top = 331
 Caption = 'Form1'
 ClientHeight = 383
 ClientWidth = 380
 Color = clWindow
 Font.Charset = DEFAULT_CHARSET
 Font.Color = clWindowText
 Font.Height = -11
 Font.Name = 'Tahoma'
 Font.Style = []
 OldCreateOrder = False
 PixelsPerInch = 96
 TextHeight = 13
 object Button1: TButton
   Left = 100
   Top = 284
   Width = 120
   Height = 36
   Caption = 'Dr'#252'ck mich'
   TabOrder = 0
 end
 object ListBox1: TListBox
   Left = 8
   Top = 7
   Width = 328
   Height = 240
   ItemHeight = 13
   TabOrder = 1
 end
end

 

how can i object use in the script?

 

i have it changed like this:

 

procedure TestForm_Init;
begin
 testform := CreateForm;
 with testform do
 begin
   Left := 653;
   Top := 331;
   Caption := 'Form1';
   ClientHeight := 383;
   ClientWidth := 380;
   Color := clWindow;
   Font.Charset := DEFAULT_CHARSET;
   Font.Color := clWindowText;
   Font.Height := -11;
   Font.Name := 'Tahoma';
   Font.Style := [];
   OldCreateOrder := False;
   PixelsPerInch := 96;
   //TextHeight := 13;
 end;
end;

 

this works :)

 

i must change it everytime or can i use the "object-code" directly?

 

i hope for answer :)

bye

Edited by Freddy
Link to comment
Share on other sites

You have to change it every time, but as I said, use the tool in the form designer to convert the dfm file directly to SCAR code. It will give you a very clean result. Just open the DFM file in the form designer and press the Code tab at the bottom to open the code view.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...