Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PRG Classes and Forms
Message
 
 
À
10/07/2007 15:19:20
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01239057
Message ID:
01239166
Vues:
10
>I think this won't work, but I want to have a method in my form that calls a method and in that method classes are defined... or something like that. Can I mix forms with text-based classes? Do I have to put them into the Main program that calls the form? Thanks!

I don't know what you are trying to accomplish, but in any case this is what I'd do if I wanted to create a class definition in a form method (or any other class method):
TEXT TO lcClassDef TEXTMERGE NOSHOW
*-- Just an example of a form class:
DEFINE CLASS MyFormClass AS Form
	Backcolor = 0
	LEFT = 0
	TOP = 0
ENDDEFINE

ENDTEXT
*
THISFORM.cClassDefinition = FORCEPATH(FORCEEXT(SYS(2015),"PRG"),GETENV("TEMP"))
*
STRTOFILE(lcClassDef,THISFORM.cClassDefinition,0)
COMPILE (THISFORM.cClassDefinition)
*
*-- In another method in your form call first the code above in a method and then instantiate your class that way:
loForm = NEWOBJECT("MyFormClass",THISFORM.cClassDefinition)
loForm.SHOW(1)
HTH
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform