>>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")
My mistake: I read the documentation. Looks like some other folks have it covered.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement