Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I can't show() my newly created object on the form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00487659
Message ID:
00487676
Vues:
10
>I'm using VFP 6.0 service pack 5.
>
>I'm trying to create an instance of a class on the fly and place it on a form, directly from my "Lookup.vcx" visual class library. I've sub-classed a pageframe which contains several data-bound textboxes and called it "InfoFrame". At the time of the form's instantiation the data is not available so I wanted to create the pageframe on the fly so I wouldn't have to set the controlsource for each textbox in code. Here's the code I'm using:
>
>frmMYFORM.NewObject("pgfINFOFRAME", "INFOFRAME", "LOOKUP.vcx")
>frmMYFORM.pgfINFOFRAME.Left = 134
>frmMYFORM.pgfINFOFRAME.Right = 140
>
>As you can see all I wanted to do is tell the pageframe where to appear on the form after I've created it. The code runs fine but nothing appears on the form. I've tried frmMYFORM.pgfINFOFRAME.Show(), but VFP says that "Property show is not found." The pageframe's visible property is also set to ".T.". It must be something simple that I'm missing but I can't find any help in the documentation online.

What you are doing is creating the object, but it is never shown because it is not added to the form.:
>frmMYFORM.NewObject("pgfINFOFRAME", "INFOFRAME", "LOOKUP.vcx")

Try:
>frmMYFORM.AddObject("pgfINFOFRAME", "INFOFRAME", "LOOKUP.vcx")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform