Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert prg to form
Message
De
08/12/2006 10:08:22
 
 
À
07/12/2006 01:54:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01175194
Message ID:
01176061
Vues:
9
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform