Hi everyBody,
How can i build a form by code, save it as scx file and in the end show it into the form designer?
I want to do a kind of builder where the user (programmer) select some custom controls I've done and in the end click "Generate Form" button.
I tried the following code but didn't work:
oForm = CREATEOBJECT("frmTest")
oForm.SaveAs("MyForm")
DEFINE CLASS frmTest as Form
Height = 300
Width = 400
AutoCenter = .T.
BorderStyle = 2
Caption = "My Form Sample"
MaxButton = .F.
MinButton = .F.
WindowType = 1
ShowWindow = 1
Name = "FrmSample"
Add OBJECT Label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
FontSize = 8, ;
Caption = "Hello Wolrd",;
Height = 19, ;
Left = 50, ;
Top = 15, ;
Width = 79, ;
TabIndex = 1, ;
Name = "Label1"
enddefine
But when I open the SCX i get the followin error:
Could you give me an example about creating and saving a form by code?
Thank you all...!
How can i build a form by code, save it as scx file and in the end show it into the form designer?
I want to do a kind of builder where the user (programmer) select some custom controls I've done and in the end click "Generate Form" button.
I tried the following code but didn't work:
oForm = CREATEOBJECT("frmTest")
oForm.SaveAs("MyForm")
DEFINE CLASS frmTest as Form
Height = 300
Width = 400
AutoCenter = .T.
BorderStyle = 2
Caption = "My Form Sample"
MaxButton = .F.
MinButton = .F.
WindowType = 1
ShowWindow = 1
Name = "FrmSample"
Add OBJECT Label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
FontSize = 8, ;
Caption = "Hello Wolrd",;
Height = 19, ;
Left = 50, ;
Top = 15, ;
Width = 79, ;
TabIndex = 1, ;
Name = "Label1"
enddefine
But when I open the SCX i get the followin error:

Could you give me an example about creating and saving a form by code?
Thank you all...!