Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Form Automatically
Message
 
 
À
16/07/1998 13:50:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00117923
Message ID:
00118257
Vues:
23
>I had the form as a class. However, I need to let the user save it as a form, but not a form class. I tried using loForm.SaveAs(cProperty3) but it doesn't save it. It only saves when I specify a name like loForm.SaveAs("MyFilename"). Is there any way I can use a variable in SaveAs?<
Hi Chu,

I created two classes, BaseClass (subclass of Form) and SubClass, subclass of BaseClass.
I then used the following code:
loObject = CREATEOBJECT("SubClass")
WITH loObject
.Property1 = "Test"
.Property2 = "Data"
.Property3 = "TestForm"
.SaveAs(.Property3)
ENDWITH
and it created a form TestForm.SCX whose parent was SubClass and whose properties were set as loObject's had been.
You may have forgotten to reference cProperty as a property: loForm.SaveAs(loForm.cProperty3)
>
>Besides, I have another question. Once I have the form saved, how can I add it to the project programmatically? Thanks a lot.
For VFP5 you'll have to hack the PJX file, unless someone already has a set of classes to do it. For VFP6, a project object has been added, which will make your task easier.

HTH,
Ned
Ned

Reality is.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform