Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert prg to form
Message
From
08/12/2006 10:08:22
 
 
To
07/12/2006 01:54:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01175194
Message ID:
01176061
Views:
8
This ia ALL you need to do.

Put this code in the click event for this button:
thisform.saveasclass("myCalsslibName","myClassName","Some description if you need it")
then just run the form, and click the button. Voila` You will now have a CLASS in the classlibrary you specified which is the same as the form code.

Like this
create class testform as form of testclasslib.vcx nowait
SET CLASSLIB TO testclasslib

lo = CREATEOBJECT("myform")
lo.SaveAsClass("TestClasslib.vcx","testform2")
lo.show()
READ events



DEFINE CLASS Myform as testform
caption = "testform"

ADD OBJECT cmdtoclasslib as commandbutton WITH ;
	Caption = 'SaveAsclass', ;
	Visible = .t.
	

PROCEDURE unload
	CLEAR EVENTS

PROCEDURE cmdtoclasslib.click
	thisform.SaveAsClass("TestClasslib.vcx","testform2")
ENDDEFINE
Where Testform class is nothing more than a subclass of a basic form.


Glenn



>hi,
>thank you for reply,
>Add a button on the form ? ok, what about aprogram....
>
>>Add a button on the form which has the following in the clidk event:
>>
thisform.saveasclass("myCalsslibName","myClassName","Some description if you need it")
>>
>>Run the form, and click the button. Voila`
>>
>>Glenn
>>>hi all,
>>>
>>>any idea to convert vfp program to form
>>>thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform