Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding an array objects to a form at runtime
Message
 
 
À
21/06/2000 07:11:09
Geert Van Snik
Zorgned Automatisering Bv
Wageningen, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00382600
Message ID:
00382715
Vues:
27
The problem is because you are adding a property to the form. Properties are not part of the form WRT to being able to display. Only objects added via CreateObject/NewObject will be able to participate in the display.

>Hi there,
>
>In my cuurent project, I want to add a series of identical objects (home-built class) to a form at runtime. The number of objects to be added depends on the size of the screen, which can be modified by the user. I tried the following code:
>
>Thisform.Addproperty('oProductkop(20)', 1)
>FOR lcTeller = 1 to thisform.aant_kolom
> *!* Thisform.Addobject("oProductkop(lcteller)", "productkop")
>*!* This.addobject("oProductkop(" + str(lcteller) + ")", "productkop")
> Thisform.oProductkop(lcteller)= newobject("productkop","Std_veld.vcx")
> WITH Thisform.oProductkop(lcTeller)
> .top =Thisform.Grid1.top - 90
> .left = Thisform.Grid1.left +(lcteller*60)
> .visible = .T.
> .tabindex = 100 + lcteller
> ENDWITH
>NEXT
>
>where productkop is the name of the class, lcteller is a counter. The WITH-ENDWITH sets several properies in the oProductkop(lcteller) objects.the :Thisform.addproperty" adds the array to the form.
>
>All works fine; the objects are added to the form, the properties are set correctly, but the objects are NOT VISIBLE on the screen and therefore useless.
>What am I doing wrong? Is there another, correct, way to add an array of identical objects to a screen at runtime?
>
>With kind regards,
>
>Geert van Snik
>Zorgned Automatisering.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform