I want to get code to create the form from existing from.
For example when I have from that have one commandbutton.
Can I get code from this form that can I paste into procedure?
Local oForm
oForm = CREATEOBJECT("myform"
oForm.show(1)
**This code bellow I need to get. Is Any possibility?
DEFINE CLASS myform AS form
Top = 0
Left = 0
Height = 198
Width = 337
DoCreate = .T.
Caption = "Form1"
Name = "clsavoidclick"
AutoCenter = .T.
ADD OBJECT command1 AS commandbutton WITH ;
Top = 72, ;
Left = 34, ;
Height = 27, ;
Width = 84, ;
Caption = "Command1", ;
Default = .T., ;
TabIndex = 2, ;
Name = "Command1"
PROCEDURE command1.Click
MESSAGEBOX("I was Clicked!"
ENDPROC
ENDDEFINE
I want to get code to create the form from existing from.
Load the class browser, and open it, switch the file type at the bottom from class to form, find your form and once the form is loaded in the class browser use the "view code" button.
A word of caution the code that this might produce is usable most of the time in a function, but in some case (like grids) it may not work. It is "pseudo-code", meaning it is the code that VFP uses to generate the form, which might not always work.
Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.