Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I can't show() my newly created object on the form
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00487659
Message ID:
00487676
Views:
11
>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")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform